proteus  1.8.0
C/C++/Fortran libraries
cpartitioning.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.24 */
2 
3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
5 #endif /* PY_SSIZE_T_CLEAN */
6 #include "Python.h"
7 #ifndef Py_PYTHON_H
8  #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10  #error Cython requires Python 2.6+ or Python 3.3+.
11 #else
12 #define CYTHON_ABI "0_29_24"
13 #define CYTHON_HEX_VERSION 0x001D18F0
14 #define CYTHON_FUTURE_DIVISION 0
15 #include <stddef.h>
16 #ifndef offsetof
17  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
18 #endif
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
20  #ifndef __stdcall
21  #define __stdcall
22  #endif
23  #ifndef __cdecl
24  #define __cdecl
25  #endif
26  #ifndef __fastcall
27  #define __fastcall
28  #endif
29 #endif
30 #ifndef DL_IMPORT
31  #define DL_IMPORT(t) t
32 #endif
33 #ifndef DL_EXPORT
34  #define DL_EXPORT(t) t
35 #endif
36 #define __PYX_COMMA ,
37 #ifndef HAVE_LONG_LONG
38  #if PY_VERSION_HEX >= 0x02070000
39  #define HAVE_LONG_LONG
40  #endif
41 #endif
42 #ifndef PY_LONG_LONG
43  #define PY_LONG_LONG LONG_LONG
44 #endif
45 #ifndef Py_HUGE_VAL
46  #define Py_HUGE_VAL HUGE_VAL
47 #endif
48 #ifdef PYPY_VERSION
49  #define CYTHON_COMPILING_IN_PYPY 1
50  #define CYTHON_COMPILING_IN_PYSTON 0
51  #define CYTHON_COMPILING_IN_CPYTHON 0
52  #undef CYTHON_USE_TYPE_SLOTS
53  #define CYTHON_USE_TYPE_SLOTS 0
54  #undef CYTHON_USE_PYTYPE_LOOKUP
55  #define CYTHON_USE_PYTYPE_LOOKUP 0
56  #if PY_VERSION_HEX < 0x03050000
57  #undef CYTHON_USE_ASYNC_SLOTS
58  #define CYTHON_USE_ASYNC_SLOTS 0
59  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60  #define CYTHON_USE_ASYNC_SLOTS 1
61  #endif
62  #undef CYTHON_USE_PYLIST_INTERNALS
63  #define CYTHON_USE_PYLIST_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_INTERNALS
65  #define CYTHON_USE_UNICODE_INTERNALS 0
66  #undef CYTHON_USE_UNICODE_WRITER
67  #define CYTHON_USE_UNICODE_WRITER 0
68  #undef CYTHON_USE_PYLONG_INTERNALS
69  #define CYTHON_USE_PYLONG_INTERNALS 0
70  #undef CYTHON_AVOID_BORROWED_REFS
71  #define CYTHON_AVOID_BORROWED_REFS 1
72  #undef CYTHON_ASSUME_SAFE_MACROS
73  #define CYTHON_ASSUME_SAFE_MACROS 0
74  #undef CYTHON_UNPACK_METHODS
75  #define CYTHON_UNPACK_METHODS 0
76  #undef CYTHON_FAST_THREAD_STATE
77  #define CYTHON_FAST_THREAD_STATE 0
78  #undef CYTHON_FAST_PYCALL
79  #define CYTHON_FAST_PYCALL 0
80  #undef CYTHON_PEP489_MULTI_PHASE_INIT
81  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82  #undef CYTHON_USE_TP_FINALIZE
83  #define CYTHON_USE_TP_FINALIZE 0
84  #undef CYTHON_USE_DICT_VERSIONS
85  #define CYTHON_USE_DICT_VERSIONS 0
86  #undef CYTHON_USE_EXC_INFO_STACK
87  #define CYTHON_USE_EXC_INFO_STACK 0
88 #elif defined(PYSTON_VERSION)
89  #define CYTHON_COMPILING_IN_PYPY 0
90  #define CYTHON_COMPILING_IN_PYSTON 1
91  #define CYTHON_COMPILING_IN_CPYTHON 0
92  #ifndef CYTHON_USE_TYPE_SLOTS
93  #define CYTHON_USE_TYPE_SLOTS 1
94  #endif
95  #undef CYTHON_USE_PYTYPE_LOOKUP
96  #define CYTHON_USE_PYTYPE_LOOKUP 0
97  #undef CYTHON_USE_ASYNC_SLOTS
98  #define CYTHON_USE_ASYNC_SLOTS 0
99  #undef CYTHON_USE_PYLIST_INTERNALS
100  #define CYTHON_USE_PYLIST_INTERNALS 0
101  #ifndef CYTHON_USE_UNICODE_INTERNALS
102  #define CYTHON_USE_UNICODE_INTERNALS 1
103  #endif
104  #undef CYTHON_USE_UNICODE_WRITER
105  #define CYTHON_USE_UNICODE_WRITER 0
106  #undef CYTHON_USE_PYLONG_INTERNALS
107  #define CYTHON_USE_PYLONG_INTERNALS 0
108  #ifndef CYTHON_AVOID_BORROWED_REFS
109  #define CYTHON_AVOID_BORROWED_REFS 0
110  #endif
111  #ifndef CYTHON_ASSUME_SAFE_MACROS
112  #define CYTHON_ASSUME_SAFE_MACROS 1
113  #endif
114  #ifndef CYTHON_UNPACK_METHODS
115  #define CYTHON_UNPACK_METHODS 1
116  #endif
117  #undef CYTHON_FAST_THREAD_STATE
118  #define CYTHON_FAST_THREAD_STATE 0
119  #undef CYTHON_FAST_PYCALL
120  #define CYTHON_FAST_PYCALL 0
121  #undef CYTHON_PEP489_MULTI_PHASE_INIT
122  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
123  #undef CYTHON_USE_TP_FINALIZE
124  #define CYTHON_USE_TP_FINALIZE 0
125  #undef CYTHON_USE_DICT_VERSIONS
126  #define CYTHON_USE_DICT_VERSIONS 0
127  #undef CYTHON_USE_EXC_INFO_STACK
128  #define CYTHON_USE_EXC_INFO_STACK 0
129 #else
130  #define CYTHON_COMPILING_IN_PYPY 0
131  #define CYTHON_COMPILING_IN_PYSTON 0
132  #define CYTHON_COMPILING_IN_CPYTHON 1
133  #ifndef CYTHON_USE_TYPE_SLOTS
134  #define CYTHON_USE_TYPE_SLOTS 1
135  #endif
136  #if PY_VERSION_HEX < 0x02070000
137  #undef CYTHON_USE_PYTYPE_LOOKUP
138  #define CYTHON_USE_PYTYPE_LOOKUP 0
139  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
140  #define CYTHON_USE_PYTYPE_LOOKUP 1
141  #endif
142  #if PY_MAJOR_VERSION < 3
143  #undef CYTHON_USE_ASYNC_SLOTS
144  #define CYTHON_USE_ASYNC_SLOTS 0
145  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
146  #define CYTHON_USE_ASYNC_SLOTS 1
147  #endif
148  #if PY_VERSION_HEX < 0x02070000
149  #undef CYTHON_USE_PYLONG_INTERNALS
150  #define CYTHON_USE_PYLONG_INTERNALS 0
151  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
152  #define CYTHON_USE_PYLONG_INTERNALS 1
153  #endif
154  #ifndef CYTHON_USE_PYLIST_INTERNALS
155  #define CYTHON_USE_PYLIST_INTERNALS 1
156  #endif
157  #ifndef CYTHON_USE_UNICODE_INTERNALS
158  #define CYTHON_USE_UNICODE_INTERNALS 1
159  #endif
160  #if PY_VERSION_HEX < 0x030300F0
161  #undef CYTHON_USE_UNICODE_WRITER
162  #define CYTHON_USE_UNICODE_WRITER 0
163  #elif !defined(CYTHON_USE_UNICODE_WRITER)
164  #define CYTHON_USE_UNICODE_WRITER 1
165  #endif
166  #ifndef CYTHON_AVOID_BORROWED_REFS
167  #define CYTHON_AVOID_BORROWED_REFS 0
168  #endif
169  #ifndef CYTHON_ASSUME_SAFE_MACROS
170  #define CYTHON_ASSUME_SAFE_MACROS 1
171  #endif
172  #ifndef CYTHON_UNPACK_METHODS
173  #define CYTHON_UNPACK_METHODS 1
174  #endif
175  #ifndef CYTHON_FAST_THREAD_STATE
176  #define CYTHON_FAST_THREAD_STATE 1
177  #endif
178  #ifndef CYTHON_FAST_PYCALL
179  #define CYTHON_FAST_PYCALL 1
180  #endif
181  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
182  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
183  #endif
184  #ifndef CYTHON_USE_TP_FINALIZE
185  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
186  #endif
187  #ifndef CYTHON_USE_DICT_VERSIONS
188  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
189  #endif
190  #ifndef CYTHON_USE_EXC_INFO_STACK
191  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
192  #endif
193 #endif
194 #if !defined(CYTHON_FAST_PYCCALL)
195 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
196 #endif
197 #if CYTHON_USE_PYLONG_INTERNALS
198  #include "longintrepr.h"
199  #undef SHIFT
200  #undef BASE
201  #undef MASK
202  #ifdef SIZEOF_VOID_P
203  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
204  #endif
205 #endif
206 #ifndef __has_attribute
207  #define __has_attribute(x) 0
208 #endif
209 #ifndef __has_cpp_attribute
210  #define __has_cpp_attribute(x) 0
211 #endif
212 #ifndef CYTHON_RESTRICT
213  #if defined(__GNUC__)
214  #define CYTHON_RESTRICT __restrict__
215  #elif defined(_MSC_VER) && _MSC_VER >= 1400
216  #define CYTHON_RESTRICT __restrict
217  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
218  #define CYTHON_RESTRICT restrict
219  #else
220  #define CYTHON_RESTRICT
221  #endif
222 #endif
223 #ifndef CYTHON_UNUSED
224 # if defined(__GNUC__)
225 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
226 # define CYTHON_UNUSED __attribute__ ((__unused__))
227 # else
228 # define CYTHON_UNUSED
229 # endif
230 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
231 # define CYTHON_UNUSED __attribute__ ((__unused__))
232 # else
233 # define CYTHON_UNUSED
234 # endif
235 #endif
236 #ifndef CYTHON_MAYBE_UNUSED_VAR
237 # if defined(__cplusplus)
238  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
239 # else
240 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
241 # endif
242 #endif
243 #ifndef CYTHON_NCP_UNUSED
244 # if CYTHON_COMPILING_IN_CPYTHON
245 # define CYTHON_NCP_UNUSED
246 # else
247 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
248 # endif
249 #endif
250 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
251 #ifdef _MSC_VER
252  #ifndef _MSC_STDINT_H_
253  #if _MSC_VER < 1300
254  typedef unsigned char uint8_t;
255  typedef unsigned int uint32_t;
256  #else
257  typedef unsigned __int8 uint8_t;
258  typedef unsigned __int32 uint32_t;
259  #endif
260  #endif
261 #else
262  #include <stdint.h>
263 #endif
264 #ifndef CYTHON_FALLTHROUGH
265  #if defined(__cplusplus) && __cplusplus >= 201103L
266  #if __has_cpp_attribute(fallthrough)
267  #define CYTHON_FALLTHROUGH [[fallthrough]]
268  #elif __has_cpp_attribute(clang::fallthrough)
269  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
270  #elif __has_cpp_attribute(gnu::fallthrough)
271  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
272  #endif
273  #endif
274  #ifndef CYTHON_FALLTHROUGH
275  #if __has_attribute(fallthrough)
276  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
277  #else
278  #define CYTHON_FALLTHROUGH
279  #endif
280  #endif
281  #if defined(__clang__ ) && defined(__apple_build_version__)
282  #if __apple_build_version__ < 7000000
283  #undef CYTHON_FALLTHROUGH
284  #define CYTHON_FALLTHROUGH
285  #endif
286  #endif
287 #endif
288 
289 #ifndef __cplusplus
290  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
291 #endif
292 #ifndef CYTHON_INLINE
293  #if defined(__clang__)
294  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
295  #else
296  #define CYTHON_INLINE inline
297  #endif
298 #endif
299 template<typename T>
300 void __Pyx_call_destructor(T& x) {
301  x.~T();
302 }
303 template<typename T>
304 class __Pyx_FakeReference {
305  public:
306  __Pyx_FakeReference() : ptr(NULL) { }
307  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
308  T *operator->() { return ptr; }
309  T *operator&() { return ptr; }
310  operator T&() { return *ptr; }
311  template<typename U> bool operator ==(U other) { return *ptr == other; }
312  template<typename U> bool operator !=(U other) { return *ptr != other; }
313  private:
314  T *ptr;
315 };
316 
317 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
318  #define Py_OptimizeFlag 0
319 #endif
320 #define __PYX_BUILD_PY_SSIZE_T "n"
321 #define CYTHON_FORMAT_SSIZE_T "z"
322 #if PY_MAJOR_VERSION < 3
323  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
324  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
325  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
326  #define __Pyx_DefaultClassType PyClass_Type
327 #else
328  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
329 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
330  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
331  PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
332 #else
333  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
334  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
335 #endif
336  #define __Pyx_DefaultClassType PyType_Type
337 #endif
338 #ifndef Py_TPFLAGS_CHECKTYPES
339  #define Py_TPFLAGS_CHECKTYPES 0
340 #endif
341 #ifndef Py_TPFLAGS_HAVE_INDEX
342  #define Py_TPFLAGS_HAVE_INDEX 0
343 #endif
344 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
345  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
346 #endif
347 #ifndef Py_TPFLAGS_HAVE_FINALIZE
348  #define Py_TPFLAGS_HAVE_FINALIZE 0
349 #endif
350 #ifndef METH_STACKLESS
351  #define METH_STACKLESS 0
352 #endif
353 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
354  #ifndef METH_FASTCALL
355  #define METH_FASTCALL 0x80
356  #endif
357  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
358  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
359  Py_ssize_t nargs, PyObject *kwnames);
360 #else
361  #define __Pyx_PyCFunctionFast _PyCFunctionFast
362  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
363 #endif
364 #if CYTHON_FAST_PYCCALL
365 #define __Pyx_PyFastCFunction_Check(func)\
366  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
367 #else
368 #define __Pyx_PyFastCFunction_Check(func) 0
369 #endif
370 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
371  #define PyObject_Malloc(s) PyMem_Malloc(s)
372  #define PyObject_Free(p) PyMem_Free(p)
373  #define PyObject_Realloc(p) PyMem_Realloc(p)
374 #endif
375 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
376  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
377  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
378  #define PyMem_RawFree(p) PyMem_Free(p)
379 #endif
380 #if CYTHON_COMPILING_IN_PYSTON
381  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
382  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
383 #else
384  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
385  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
386 #endif
387 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
388  #define __Pyx_PyThreadState_Current PyThreadState_GET()
389 #elif PY_VERSION_HEX >= 0x03060000
390  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
391 #elif PY_VERSION_HEX >= 0x03000000
392  #define __Pyx_PyThreadState_Current PyThreadState_GET()
393 #else
394  #define __Pyx_PyThreadState_Current _PyThreadState_Current
395 #endif
396 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
397 #include "pythread.h"
398 #define Py_tss_NEEDS_INIT 0
399 typedef int Py_tss_t;
400 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
401  *key = PyThread_create_key();
402  return 0;
403 }
404 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
405  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
406  *key = Py_tss_NEEDS_INIT;
407  return key;
408 }
409 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
410  PyObject_Free(key);
411 }
412 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
413  return *key != Py_tss_NEEDS_INIT;
414 }
415 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
416  PyThread_delete_key(*key);
417  *key = Py_tss_NEEDS_INIT;
418 }
419 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
420  return PyThread_set_key_value(*key, value);
421 }
422 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
423  return PyThread_get_key_value(*key);
424 }
425 #endif
426 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
427 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
428 #else
429 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
430 #endif
431 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
432  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
433  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
434 #else
435  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
436  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
437 #endif
438 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
439 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
440 #else
441 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
442 #endif
443 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
444  #define CYTHON_PEP393_ENABLED 1
445  #if defined(PyUnicode_IS_READY)
446  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
447  0 : _PyUnicode_Ready((PyObject *)(op)))
448  #else
449  #define __Pyx_PyUnicode_READY(op) (0)
450  #endif
451  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
452  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
453  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
454  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
455  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
456  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
457  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
458  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
459  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
460  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
461  #else
462  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
463  #endif
464  #else
465  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
466  #endif
467 #else
468  #define CYTHON_PEP393_ENABLED 0
469  #define PyUnicode_1BYTE_KIND 1
470  #define PyUnicode_2BYTE_KIND 2
471  #define PyUnicode_4BYTE_KIND 4
472  #define __Pyx_PyUnicode_READY(op) (0)
473  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
474  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
475  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
476  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
477  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
478  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
479  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
480  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
481 #endif
482 #if CYTHON_COMPILING_IN_PYPY
483  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
484  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
485 #else
486  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
487  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
488  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
489 #endif
490 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
491  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
492 #endif
493 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
494  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
495 #endif
496 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
497  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
498 #endif
499 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
500 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
501 #if PY_MAJOR_VERSION >= 3
502  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
503 #else
504  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
505 #endif
506 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
507  #define PyObject_ASCII(o) PyObject_Repr(o)
508 #endif
509 #if PY_MAJOR_VERSION >= 3
510  #define PyBaseString_Type PyUnicode_Type
511  #define PyStringObject PyUnicodeObject
512  #define PyString_Type PyUnicode_Type
513  #define PyString_Check PyUnicode_Check
514  #define PyString_CheckExact PyUnicode_CheckExact
515 #ifndef PyObject_Unicode
516  #define PyObject_Unicode PyObject_Str
517 #endif
518 #endif
519 #if PY_MAJOR_VERSION >= 3
520  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
521  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
522 #else
523  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
524  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
525 #endif
526 #ifndef PySet_CheckExact
527  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
528 #endif
529 #if PY_VERSION_HEX >= 0x030900A4
530  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
531  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
532 #else
533  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
534  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
535 #endif
536 #if CYTHON_ASSUME_SAFE_MACROS
537  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
538 #else
539  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
540 #endif
541 #if PY_MAJOR_VERSION >= 3
542  #define PyIntObject PyLongObject
543  #define PyInt_Type PyLong_Type
544  #define PyInt_Check(op) PyLong_Check(op)
545  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
546  #define PyInt_FromString PyLong_FromString
547  #define PyInt_FromUnicode PyLong_FromUnicode
548  #define PyInt_FromLong PyLong_FromLong
549  #define PyInt_FromSize_t PyLong_FromSize_t
550  #define PyInt_FromSsize_t PyLong_FromSsize_t
551  #define PyInt_AsLong PyLong_AsLong
552  #define PyInt_AS_LONG PyLong_AS_LONG
553  #define PyInt_AsSsize_t PyLong_AsSsize_t
554  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
555  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
556  #define PyNumber_Int PyNumber_Long
557 #endif
558 #if PY_MAJOR_VERSION >= 3
559  #define PyBoolObject PyLongObject
560 #endif
561 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
562  #ifndef PyUnicode_InternFromString
563  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
564  #endif
565 #endif
566 #if PY_VERSION_HEX < 0x030200A4
567  typedef long Py_hash_t;
568  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
569  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
570 #else
571  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
572  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
573 #endif
574 #if PY_MAJOR_VERSION >= 3
575  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
576 #else
577  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
578 #endif
579 #if CYTHON_USE_ASYNC_SLOTS
580  #if PY_VERSION_HEX >= 0x030500B1
581  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
582  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
583  #else
584  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
585  #endif
586 #else
587  #define __Pyx_PyType_AsAsync(obj) NULL
588 #endif
589 #ifndef __Pyx_PyAsyncMethodsStruct
590  typedef struct {
591  unaryfunc am_await;
592  unaryfunc am_aiter;
593  unaryfunc am_anext;
594  } __Pyx_PyAsyncMethodsStruct;
595 #endif
596 
597 #if defined(WIN32) || defined(MS_WINDOWS)
598  #define _USE_MATH_DEFINES
599 #endif
600 #include <math.h>
601 #ifdef NAN
602 #define __PYX_NAN() ((float) NAN)
603 #else
604 static CYTHON_INLINE float __PYX_NAN() {
605  float value;
606  memset(&value, 0xFF, sizeof(value));
607  return value;
608 }
609 #endif
610 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
611 #define __Pyx_truncl trunc
612 #else
613 #define __Pyx_truncl truncl
614 #endif
615 
616 #define __PYX_MARK_ERR_POS(f_index, lineno) \
617  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
618 #define __PYX_ERR(f_index, lineno, Ln_error) \
619  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
620 
621 #ifndef __PYX_EXTERN_C
622  #ifdef __cplusplus
623  #define __PYX_EXTERN_C extern "C"
624  #else
625  #define __PYX_EXTERN_C extern
626  #endif
627 #endif
628 
629 #define __PYX_HAVE__cpartitioning
630 #define __PYX_HAVE_API__cpartitioning
631 /* Early includes */
632 #include <string.h>
633 #include <stdio.h>
634 #include "numpy/arrayobject.h"
635 #include "numpy/ndarrayobject.h"
636 #include "numpy/ndarraytypes.h"
637 #include "numpy/arrayscalars.h"
638 #include "numpy/ufuncobject.h"
639 
640  /* NumPy API declarations from "numpy/__init__.pxd" */
641 
642 #include "mpi.h"
643 #include "mesh.h"
644 #include "partitioning.h"
645 #include "pythread.h"
646 #include <stdlib.h>
647 #include "pystate.h"
648 #ifdef _OPENMP
649 #include <omp.h>
650 #endif /* _OPENMP */
651 
652 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
653 #define CYTHON_WITHOUT_ASSERTIONS
654 #endif
655 
656 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
657  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
658 
659 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
660 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
661 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
662 #define __PYX_DEFAULT_STRING_ENCODING ""
663 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
664 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
665 #define __Pyx_uchar_cast(c) ((unsigned char)c)
666 #define __Pyx_long_cast(x) ((long)x)
667 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
668  (sizeof(type) < sizeof(Py_ssize_t)) ||\
669  (sizeof(type) > sizeof(Py_ssize_t) &&\
670  likely(v < (type)PY_SSIZE_T_MAX ||\
671  v == (type)PY_SSIZE_T_MAX) &&\
672  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
673  v == (type)PY_SSIZE_T_MIN))) ||\
674  (sizeof(type) == sizeof(Py_ssize_t) &&\
675  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
676  v == (type)PY_SSIZE_T_MAX))) )
677 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
678  return (size_t) i < (size_t) limit;
679 }
680 #if defined (__cplusplus) && __cplusplus >= 201103L
681  #include <cstdlib>
682  #define __Pyx_sst_abs(value) std::abs(value)
683 #elif SIZEOF_INT >= SIZEOF_SIZE_T
684  #define __Pyx_sst_abs(value) abs(value)
685 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
686  #define __Pyx_sst_abs(value) labs(value)
687 #elif defined (_MSC_VER)
688  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
689 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
690  #define __Pyx_sst_abs(value) llabs(value)
691 #elif defined (__GNUC__)
692  #define __Pyx_sst_abs(value) __builtin_llabs(value)
693 #else
694  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
695 #endif
696 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
697 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
698 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
699 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
700 #define __Pyx_PyBytes_FromString PyBytes_FromString
701 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
702 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
703 #if PY_MAJOR_VERSION < 3
704  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
705  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
706 #else
707  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
708  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
709 #endif
710 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
711 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
712 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
713 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
714 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
715 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
716 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
717 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
718 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
719 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
720 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
721 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
722 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
723 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
724 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
725 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
726 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
727  const Py_UNICODE *u_end = u;
728  while (*u_end++) ;
729  return (size_t)(u_end - u - 1);
730 }
731 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
732 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
733 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
734 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
735 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
736 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
737 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
738 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
739 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
740 #define __Pyx_PySequence_Tuple(obj)\
741  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
742 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
743 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
744 #if CYTHON_ASSUME_SAFE_MACROS
745 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
746 #else
747 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
748 #endif
749 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
750 #if PY_MAJOR_VERSION >= 3
751 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
752 #else
753 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
754 #endif
755 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
756 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
757 static int __Pyx_sys_getdefaultencoding_not_ascii;
758 static int __Pyx_init_sys_getdefaultencoding_params(void) {
759  PyObject* sys;
760  PyObject* default_encoding = NULL;
761  PyObject* ascii_chars_u = NULL;
762  PyObject* ascii_chars_b = NULL;
763  const char* default_encoding_c;
764  sys = PyImport_ImportModule("sys");
765  if (!sys) goto bad;
766  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
767  Py_DECREF(sys);
768  if (!default_encoding) goto bad;
769  default_encoding_c = PyBytes_AsString(default_encoding);
770  if (!default_encoding_c) goto bad;
771  if (strcmp(default_encoding_c, "ascii") == 0) {
772  __Pyx_sys_getdefaultencoding_not_ascii = 0;
773  } else {
774  char ascii_chars[128];
775  int c;
776  for (c = 0; c < 128; c++) {
777  ascii_chars[c] = c;
778  }
779  __Pyx_sys_getdefaultencoding_not_ascii = 1;
780  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
781  if (!ascii_chars_u) goto bad;
782  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
783  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
784  PyErr_Format(
785  PyExc_ValueError,
786  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
787  default_encoding_c);
788  goto bad;
789  }
790  Py_DECREF(ascii_chars_u);
791  Py_DECREF(ascii_chars_b);
792  }
793  Py_DECREF(default_encoding);
794  return 0;
795 bad:
796  Py_XDECREF(default_encoding);
797  Py_XDECREF(ascii_chars_u);
798  Py_XDECREF(ascii_chars_b);
799  return -1;
800 }
801 #endif
802 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
803 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
804 #else
805 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
806 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
807 static char* __PYX_DEFAULT_STRING_ENCODING;
808 static int __Pyx_init_sys_getdefaultencoding_params(void) {
809  PyObject* sys;
810  PyObject* default_encoding = NULL;
811  char* default_encoding_c;
812  sys = PyImport_ImportModule("sys");
813  if (!sys) goto bad;
814  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
815  Py_DECREF(sys);
816  if (!default_encoding) goto bad;
817  default_encoding_c = PyBytes_AsString(default_encoding);
818  if (!default_encoding_c) goto bad;
819  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
820  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
821  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
822  Py_DECREF(default_encoding);
823  return 0;
824 bad:
825  Py_XDECREF(default_encoding);
826  return -1;
827 }
828 #endif
829 #endif
830 
831 
832 /* Test for GCC > 2.95 */
833 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
834  #define likely(x) __builtin_expect(!!(x), 1)
835  #define unlikely(x) __builtin_expect(!!(x), 0)
836 #else /* !__GNUC__ or GCC < 2.95 */
837  #define likely(x) (x)
838  #define unlikely(x) (x)
839 #endif /* __GNUC__ */
840 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
841 
842 static PyObject *__pyx_m = NULL;
843 static PyObject *__pyx_d;
844 static PyObject *__pyx_b;
845 static PyObject *__pyx_cython_runtime = NULL;
846 static PyObject *__pyx_empty_tuple;
847 static PyObject *__pyx_empty_bytes;
848 static PyObject *__pyx_empty_unicode;
849 static int __pyx_lineno;
850 static int __pyx_clineno = 0;
851 static const char * __pyx_cfilenm= __FILE__;
852 static const char *__pyx_filename;
853 
854 /* Header.proto */
855 #if !defined(CYTHON_CCOMPLEX)
856  #if defined(__cplusplus)
857  #define CYTHON_CCOMPLEX 1
858  #elif defined(_Complex_I)
859  #define CYTHON_CCOMPLEX 1
860  #else
861  #define CYTHON_CCOMPLEX 0
862  #endif
863 #endif
864 #if CYTHON_CCOMPLEX
865  #ifdef __cplusplus
866  #include <complex>
867  #else
868  #include <complex.h>
869  #endif
870 #endif
871 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
872  #undef _Complex_I
873  #define _Complex_I 1.0fj
874 #endif
875 
876 
877 static const char *__pyx_f[] = {
878  "proteus/cpartitioning.pyx",
879  "__init__.pxd",
880  "stringsource",
881  "type.pxd",
882  "MPI.pxd",
883  "proteus/cmeshTools.pxd",
884 };
885 /* ForceInitThreads.proto */
886 #ifndef __PYX_FORCE_INIT_THREADS
887  #define __PYX_FORCE_INIT_THREADS 0
888 #endif
889 
890 /* NoFastGil.proto */
891 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
892 #define __Pyx_PyGILState_Release PyGILState_Release
893 #define __Pyx_FastGIL_Remember()
894 #define __Pyx_FastGIL_Forget()
895 #define __Pyx_FastGilFuncInit()
896 
897 /* BufferFormatStructs.proto */
898 #define IS_UNSIGNED(type) (((type) -1) > 0)
899 struct __Pyx_StructField_;
900 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
901 typedef struct {
902  const char* name;
903  struct __Pyx_StructField_* fields;
904  size_t size;
905  size_t arraysize[8];
906  int ndim;
907  char typegroup;
908  char is_unsigned;
909  int flags;
910 } __Pyx_TypeInfo;
911 typedef struct __Pyx_StructField_ {
912  __Pyx_TypeInfo* type;
913  const char* name;
914  size_t offset;
915 } __Pyx_StructField;
916 typedef struct {
917  __Pyx_StructField* field;
918  size_t parent_offset;
919 } __Pyx_BufFmt_StackElem;
920 typedef struct {
921  __Pyx_StructField root;
922  __Pyx_BufFmt_StackElem* head;
923  size_t fmt_offset;
924  size_t new_count, enc_count;
925  size_t struct_alignment;
926  int is_complex;
927  char enc_type;
928  char new_packmode;
929  char enc_packmode;
930  char is_valid_array;
931 } __Pyx_BufFmt_Context;
932 
933 /* Atomics.proto */
934 #include <pythread.h>
935 #ifndef CYTHON_ATOMICS
936  #define CYTHON_ATOMICS 1
937 #endif
938 #define __pyx_atomic_int_type int
939 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
940  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
941  !defined(__i386__)
942  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
943  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
944  #ifdef __PYX_DEBUG_ATOMICS
945  #warning "Using GNU atomics"
946  #endif
947 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
948  #include <Windows.h>
949  #undef __pyx_atomic_int_type
950  #define __pyx_atomic_int_type LONG
951  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
952  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
953  #ifdef __PYX_DEBUG_ATOMICS
954  #pragma message ("Using MSVC atomics")
955  #endif
956 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
957  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
958  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
959  #ifdef __PYX_DEBUG_ATOMICS
960  #warning "Using Intel atomics"
961  #endif
962 #else
963  #undef CYTHON_ATOMICS
964  #define CYTHON_ATOMICS 0
965  #ifdef __PYX_DEBUG_ATOMICS
966  #warning "Not using atomics"
967  #endif
968 #endif
969 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
970 #if CYTHON_ATOMICS
971  #define __pyx_add_acquisition_count(memview)\
972  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
973  #define __pyx_sub_acquisition_count(memview)\
974  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
975 #else
976  #define __pyx_add_acquisition_count(memview)\
977  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
978  #define __pyx_sub_acquisition_count(memview)\
979  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
980 #endif
981 
982 /* MemviewSliceStruct.proto */
983 struct __pyx_memoryview_obj;
984 typedef struct {
985  struct __pyx_memoryview_obj *memview;
986  char *data;
987  Py_ssize_t shape[8];
988  Py_ssize_t strides[8];
989  Py_ssize_t suboffsets[8];
990 } __Pyx_memviewslice;
991 #define __Pyx_MemoryView_Len(m) (m.shape[0])
992 
993 
994 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":690
995  * # in Cython to enable them only on the right systems.
996  *
997  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
998  * ctypedef npy_int16 int16_t
999  * ctypedef npy_int32 int32_t
1000  */
1001 typedef npy_int8 __pyx_t_5numpy_int8_t;
1002 
1003 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":691
1004  *
1005  * ctypedef npy_int8 int8_t
1006  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1007  * ctypedef npy_int32 int32_t
1008  * ctypedef npy_int64 int64_t
1009  */
1010 typedef npy_int16 __pyx_t_5numpy_int16_t;
1011 
1012 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":692
1013  * ctypedef npy_int8 int8_t
1014  * ctypedef npy_int16 int16_t
1015  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1016  * ctypedef npy_int64 int64_t
1017  * #ctypedef npy_int96 int96_t
1018  */
1019 typedef npy_int32 __pyx_t_5numpy_int32_t;
1020 
1021 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":693
1022  * ctypedef npy_int16 int16_t
1023  * ctypedef npy_int32 int32_t
1024  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1025  * #ctypedef npy_int96 int96_t
1026  * #ctypedef npy_int128 int128_t
1027  */
1028 typedef npy_int64 __pyx_t_5numpy_int64_t;
1029 
1030 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":697
1031  * #ctypedef npy_int128 int128_t
1032  *
1033  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1034  * ctypedef npy_uint16 uint16_t
1035  * ctypedef npy_uint32 uint32_t
1036  */
1037 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1038 
1039 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":698
1040  *
1041  * ctypedef npy_uint8 uint8_t
1042  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1043  * ctypedef npy_uint32 uint32_t
1044  * ctypedef npy_uint64 uint64_t
1045  */
1046 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1047 
1048 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":699
1049  * ctypedef npy_uint8 uint8_t
1050  * ctypedef npy_uint16 uint16_t
1051  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1052  * ctypedef npy_uint64 uint64_t
1053  * #ctypedef npy_uint96 uint96_t
1054  */
1055 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1056 
1057 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":700
1058  * ctypedef npy_uint16 uint16_t
1059  * ctypedef npy_uint32 uint32_t
1060  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1061  * #ctypedef npy_uint96 uint96_t
1062  * #ctypedef npy_uint128 uint128_t
1063  */
1064 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1065 
1066 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":704
1067  * #ctypedef npy_uint128 uint128_t
1068  *
1069  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1070  * ctypedef npy_float64 float64_t
1071  * #ctypedef npy_float80 float80_t
1072  */
1073 typedef npy_float32 __pyx_t_5numpy_float32_t;
1074 
1075 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":705
1076  *
1077  * ctypedef npy_float32 float32_t
1078  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1079  * #ctypedef npy_float80 float80_t
1080  * #ctypedef npy_float128 float128_t
1081  */
1082 typedef npy_float64 __pyx_t_5numpy_float64_t;
1083 
1084 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":714
1085  * # The int types are mapped a bit surprising --
1086  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1087  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1088  * ctypedef npy_longlong long_t
1089  * ctypedef npy_longlong longlong_t
1090  */
1091 typedef npy_long __pyx_t_5numpy_int_t;
1092 
1093 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":715
1094  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1095  * ctypedef npy_long int_t
1096  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1097  * ctypedef npy_longlong longlong_t
1098  *
1099  */
1100 typedef npy_longlong __pyx_t_5numpy_long_t;
1101 
1102 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":716
1103  * ctypedef npy_long int_t
1104  * ctypedef npy_longlong long_t
1105  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1106  *
1107  * ctypedef npy_ulong uint_t
1108  */
1109 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1110 
1111 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":718
1112  * ctypedef npy_longlong longlong_t
1113  *
1114  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1115  * ctypedef npy_ulonglong ulong_t
1116  * ctypedef npy_ulonglong ulonglong_t
1117  */
1118 typedef npy_ulong __pyx_t_5numpy_uint_t;
1119 
1120 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":719
1121  *
1122  * ctypedef npy_ulong uint_t
1123  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1124  * ctypedef npy_ulonglong ulonglong_t
1125  *
1126  */
1127 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1128 
1129 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":720
1130  * ctypedef npy_ulong uint_t
1131  * ctypedef npy_ulonglong ulong_t
1132  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1133  *
1134  * ctypedef npy_intp intp_t
1135  */
1136 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1137 
1138 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":722
1139  * ctypedef npy_ulonglong ulonglong_t
1140  *
1141  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1142  * ctypedef npy_uintp uintp_t
1143  *
1144  */
1145 typedef npy_intp __pyx_t_5numpy_intp_t;
1146 
1147 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":723
1148  *
1149  * ctypedef npy_intp intp_t
1150  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1151  *
1152  * ctypedef npy_double float_t
1153  */
1154 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1155 
1156 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":725
1157  * ctypedef npy_uintp uintp_t
1158  *
1159  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1160  * ctypedef npy_double double_t
1161  * ctypedef npy_longdouble longdouble_t
1162  */
1163 typedef npy_double __pyx_t_5numpy_float_t;
1164 
1165 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":726
1166  *
1167  * ctypedef npy_double float_t
1168  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1169  * ctypedef npy_longdouble longdouble_t
1170  *
1171  */
1172 typedef npy_double __pyx_t_5numpy_double_t;
1173 
1174 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":727
1175  * ctypedef npy_double float_t
1176  * ctypedef npy_double double_t
1177  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1178  *
1179  * ctypedef npy_cfloat cfloat_t
1180  */
1181 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1182 /* Declarations.proto */
1183 #if CYTHON_CCOMPLEX
1184  #ifdef __cplusplus
1185  typedef ::std::complex< float > __pyx_t_float_complex;
1186  #else
1187  typedef float _Complex __pyx_t_float_complex;
1188  #endif
1189 #else
1190  typedef struct { float real, imag; } __pyx_t_float_complex;
1191 #endif
1192 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1193 
1194 /* Declarations.proto */
1195 #if CYTHON_CCOMPLEX
1196  #ifdef __cplusplus
1197  typedef ::std::complex< double > __pyx_t_double_complex;
1198  #else
1199  typedef double _Complex __pyx_t_double_complex;
1200  #endif
1201 #else
1202  typedef struct { double real, imag; } __pyx_t_double_complex;
1203 #endif
1204 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1205 
1206 
1207 /*--- Type declarations ---*/
1208 struct PyMPIStatusObject;
1209 struct PyMPIDatatypeObject;
1210 struct PyMPIRequestObject;
1211 struct PyMPIPrequestObject;
1212 struct PyMPIGrequestObject;
1213 struct PyMPIMessageObject;
1214 struct PyMPIOpObject;
1215 struct PyMPIGroupObject;
1216 struct PyMPIInfoObject;
1217 struct PyMPIErrhandlerObject;
1218 struct PyMPICommObject;
1219 struct PyMPIIntracommObject;
1220 struct PyMPITopocommObject;
1221 struct PyMPICartcommObject;
1222 struct PyMPIGraphcommObject;
1223 struct PyMPIDistgraphcommObject;
1224 struct PyMPIIntercommObject;
1225 struct PyMPIWinObject;
1226 struct PyMPIFileObject;
1227 struct __pyx_obj_7proteus_10cmeshTools_CMesh;
1228 struct __pyx_array_obj;
1229 struct __pyx_MemviewEnum_obj;
1230 struct __pyx_memoryview_obj;
1231 struct __pyx_memoryviewslice_obj;
1232 
1233 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":729
1234  * ctypedef npy_longdouble longdouble_t
1235  *
1236  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1237  * ctypedef npy_cdouble cdouble_t
1238  * ctypedef npy_clongdouble clongdouble_t
1239  */
1240 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1241 
1242 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":730
1243  *
1244  * ctypedef npy_cfloat cfloat_t
1245  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1246  * ctypedef npy_clongdouble clongdouble_t
1247  *
1248  */
1249 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1250 
1251 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":731
1252  * ctypedef npy_cfloat cfloat_t
1253  * ctypedef npy_cdouble cdouble_t
1254  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1255  *
1256  * ctypedef npy_cdouble complex_t
1257  */
1258 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1259 
1260 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":733
1261  * ctypedef npy_clongdouble clongdouble_t
1262  *
1263  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1264  *
1265  * cdef inline object PyArray_MultiIterNew1(a):
1266  */
1267 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1268 
1269 /* "mpi4py/MPI.pxd":28
1270  * ctypedef MPI_Count Count "MPI_Count"
1271  *
1272  * ctypedef public api class Status [ # <<<<<<<<<<<<<<
1273  * type PyMPIStatus_Type,
1274  * object PyMPIStatusObject,
1275  */
1276 struct PyMPIStatusObject {
1277  PyObject_HEAD
1278  MPI_Status ob_mpi;
1279  unsigned int flags;
1280 };
1281 typedef struct PyMPIStatusObject PyMPIStatusObject;
1282 
1283 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIStatus_Type;
1284 
1285 /* "mpi4py/MPI.pxd":35
1286  * cdef unsigned flags
1287  *
1288  * ctypedef public api class Datatype [ # <<<<<<<<<<<<<<
1289  * type PyMPIDatatype_Type,
1290  * object PyMPIDatatypeObject,
1291  */
1292 struct PyMPIDatatypeObject {
1293  PyObject_HEAD
1294  MPI_Datatype ob_mpi;
1295  unsigned int flags;
1296 };
1297 typedef struct PyMPIDatatypeObject PyMPIDatatypeObject;
1298 
1299 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIDatatype_Type;
1300 
1301 /* "mpi4py/MPI.pxd":42
1302  * cdef unsigned flags
1303  *
1304  * ctypedef public api class Request [ # <<<<<<<<<<<<<<
1305  * type PyMPIRequest_Type,
1306  * object PyMPIRequestObject,
1307  */
1308 struct PyMPIRequestObject {
1309  PyObject_HEAD
1310  MPI_Request ob_mpi;
1311  unsigned int flags;
1312  PyObject *ob_buf;
1313 };
1314 typedef struct PyMPIRequestObject PyMPIRequestObject;
1315 
1316 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIRequest_Type;
1317 
1318 /* "mpi4py/MPI.pxd":50
1319  * cdef object ob_buf
1320  *
1321  * ctypedef public api class Prequest(Request) [ # <<<<<<<<<<<<<<
1322  * type PyMPIPrequest_Type,
1323  * object PyMPIPrequestObject,
1324  */
1325 struct PyMPIPrequestObject {
1326  struct PyMPIRequestObject __pyx_base;
1327 };
1328 typedef struct PyMPIPrequestObject PyMPIPrequestObject;
1329 
1330 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIPrequest_Type;
1331 
1332 /* "mpi4py/MPI.pxd":56
1333  * pass
1334  *
1335  * ctypedef public api class Grequest(Request) [ # <<<<<<<<<<<<<<
1336  * type PyMPIGrequest_Type,
1337  * object PyMPIGrequestObject,
1338  */
1339 struct PyMPIGrequestObject {
1340  struct PyMPIRequestObject __pyx_base;
1341  MPI_Request ob_grequest;
1342 };
1343 typedef struct PyMPIGrequestObject PyMPIGrequestObject;
1344 
1345 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGrequest_Type;
1346 
1347 /* "mpi4py/MPI.pxd":62
1348  * cdef MPI_Request ob_grequest
1349  *
1350  * ctypedef public api class Message [ # <<<<<<<<<<<<<<
1351  * type PyMPIMessage_Type,
1352  * object PyMPIMessageObject,
1353  */
1354 struct PyMPIMessageObject {
1355  PyObject_HEAD
1356  MPI_Message ob_mpi;
1357  unsigned int flags;
1358  PyObject *ob_buf;
1359 };
1360 typedef struct PyMPIMessageObject PyMPIMessageObject;
1361 
1362 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIMessage_Type;
1363 
1364 /* "mpi4py/MPI.pxd":70
1365  * cdef object ob_buf
1366  *
1367  * ctypedef public api class Op [ # <<<<<<<<<<<<<<
1368  * type PyMPIOp_Type,
1369  * object PyMPIOpObject,
1370  */
1371 struct PyMPIOpObject {
1372  PyObject_HEAD
1373  MPI_Op ob_mpi;
1374  unsigned int flags;
1375  PyObject *(*ob_func)(PyObject *, PyObject *);
1376  int ob_usrid;
1377 };
1378 typedef struct PyMPIOpObject PyMPIOpObject;
1379 
1380 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIOp_Type;
1381 
1382 /* "mpi4py/MPI.pxd":79
1383  * cdef int ob_usrid
1384  *
1385  * ctypedef public api class Group [ # <<<<<<<<<<<<<<
1386  * type PyMPIGroup_Type,
1387  * object PyMPIGroupObject,
1388  */
1389 struct PyMPIGroupObject {
1390  PyObject_HEAD
1391  MPI_Group ob_mpi;
1392  unsigned int flags;
1393 };
1394 typedef struct PyMPIGroupObject PyMPIGroupObject;
1395 
1396 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGroup_Type;
1397 
1398 /* "mpi4py/MPI.pxd":86
1399  * cdef unsigned flags
1400  *
1401  * ctypedef public api class Info [ # <<<<<<<<<<<<<<
1402  * type PyMPIInfo_Type,
1403  * object PyMPIInfoObject,
1404  */
1405 struct PyMPIInfoObject {
1406  PyObject_HEAD
1407  MPI_Info ob_mpi;
1408  unsigned int flags;
1409 };
1410 typedef struct PyMPIInfoObject PyMPIInfoObject;
1411 
1412 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIInfo_Type;
1413 
1414 /* "mpi4py/MPI.pxd":93
1415  * cdef unsigned flags
1416  *
1417  * ctypedef public api class Errhandler [ # <<<<<<<<<<<<<<
1418  * type PyMPIErrhandler_Type,
1419  * object PyMPIErrhandlerObject,
1420  */
1421 struct PyMPIErrhandlerObject {
1422  PyObject_HEAD
1423  MPI_Errhandler ob_mpi;
1424  unsigned int flags;
1425 };
1426 typedef struct PyMPIErrhandlerObject PyMPIErrhandlerObject;
1427 
1428 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIErrhandler_Type;
1429 
1430 /* "mpi4py/MPI.pxd":100
1431  * cdef unsigned flags
1432  *
1433  * ctypedef public api class Comm [ # <<<<<<<<<<<<<<
1434  * type PyMPIComm_Type,
1435  * object PyMPICommObject,
1436  */
1437 struct PyMPICommObject {
1438  PyObject_HEAD
1439  MPI_Comm ob_mpi;
1440  unsigned int flags;
1441 };
1442 typedef struct PyMPICommObject PyMPICommObject;
1443 
1444 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIComm_Type;
1445 
1446 /* "mpi4py/MPI.pxd":107
1447  * cdef unsigned flags
1448  *
1449  * ctypedef public api class Intracomm(Comm) [ # <<<<<<<<<<<<<<
1450  * type PyMPIIntracomm_Type,
1451  * object PyMPIIntracommObject,
1452  */
1453 struct PyMPIIntracommObject {
1454  struct PyMPICommObject __pyx_base;
1455 };
1456 typedef struct PyMPIIntracommObject PyMPIIntracommObject;
1457 
1458 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIIntracomm_Type;
1459 
1460 /* "mpi4py/MPI.pxd":113
1461  * pass
1462  *
1463  * ctypedef public api class Topocomm(Intracomm) [ # <<<<<<<<<<<<<<
1464  * type PyMPITopocomm_Type,
1465  * object PyMPITopocommObject,
1466  */
1467 struct PyMPITopocommObject {
1468  struct PyMPIIntracommObject __pyx_base;
1469 };
1470 typedef struct PyMPITopocommObject PyMPITopocommObject;
1471 
1472 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPITopocomm_Type;
1473 
1474 /* "mpi4py/MPI.pxd":119
1475  * pass
1476  *
1477  * ctypedef public api class Cartcomm(Topocomm) [ # <<<<<<<<<<<<<<
1478  * type PyMPICartcomm_Type,
1479  * object PyMPICartcommObject,
1480  */
1481 struct PyMPICartcommObject {
1482  struct PyMPITopocommObject __pyx_base;
1483 };
1484 typedef struct PyMPICartcommObject PyMPICartcommObject;
1485 
1486 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPICartcomm_Type;
1487 
1488 /* "mpi4py/MPI.pxd":125
1489  * pass
1490  *
1491  * ctypedef public api class Graphcomm(Topocomm) [ # <<<<<<<<<<<<<<
1492  * type PyMPIGraphcomm_Type,
1493  * object PyMPIGraphcommObject,
1494  */
1495 struct PyMPIGraphcommObject {
1496  struct PyMPITopocommObject __pyx_base;
1497 };
1498 typedef struct PyMPIGraphcommObject PyMPIGraphcommObject;
1499 
1500 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGraphcomm_Type;
1501 
1502 /* "mpi4py/MPI.pxd":131
1503  * pass
1504  *
1505  * ctypedef public api class Distgraphcomm(Topocomm) [ # <<<<<<<<<<<<<<
1506  * type PyMPIDistgraphcomm_Type,
1507  * object PyMPIDistgraphcommObject,
1508  */
1509 struct PyMPIDistgraphcommObject {
1510  struct PyMPITopocommObject __pyx_base;
1511 };
1512 typedef struct PyMPIDistgraphcommObject PyMPIDistgraphcommObject;
1513 
1514 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIDistgraphcomm_Type;
1515 
1516 /* "mpi4py/MPI.pxd":137
1517  * pass
1518  *
1519  * ctypedef public api class Intercomm(Comm) [ # <<<<<<<<<<<<<<
1520  * type PyMPIIntercomm_Type,
1521  * object PyMPIIntercommObject,
1522  */
1523 struct PyMPIIntercommObject {
1524  struct PyMPICommObject __pyx_base;
1525 };
1526 typedef struct PyMPIIntercommObject PyMPIIntercommObject;
1527 
1528 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIIntercomm_Type;
1529 
1530 /* "mpi4py/MPI.pxd":143
1531  * pass
1532  *
1533  * ctypedef public api class Win [ # <<<<<<<<<<<<<<
1534  * type PyMPIWin_Type,
1535  * object PyMPIWinObject,
1536  */
1537 struct PyMPIWinObject {
1538  PyObject_HEAD
1539  MPI_Win ob_mpi;
1540  unsigned int flags;
1541  PyObject *ob_mem;
1542 };
1543 typedef struct PyMPIWinObject PyMPIWinObject;
1544 
1545 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIWin_Type;
1546 
1547 /* "mpi4py/MPI.pxd":151
1548  * cdef object ob_mem
1549  *
1550  * ctypedef public api class File [ # <<<<<<<<<<<<<<
1551  * type PyMPIFile_Type,
1552  * object PyMPIFileObject,
1553  */
1554 struct PyMPIFileObject {
1555  PyObject_HEAD
1556  MPI_File ob_mpi;
1557  unsigned int flags;
1558 };
1559 typedef struct PyMPIFileObject PyMPIFileObject;
1560 
1561 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIFile_Type;
1562 
1563 /* "cmeshTools.pxd":5
1564  * cimport mesh as cppm
1565  *
1566  * cdef class CMesh: # <<<<<<<<<<<<<<
1567  * cdef cppm.Mesh mesh
1568  * cdef public:
1569  */
1570 struct __pyx_obj_7proteus_10cmeshTools_CMesh {
1571  PyObject_HEAD
1572  struct Mesh mesh;
1573  int nElements_global;
1574  int nNodes_global;
1575  int nNodes_element;
1581  int max_nElements_node;
1582  int nEdges_global;
1584  PyArrayObject *elementNodesArray;
1585  PyArrayObject *nodeElementsArray;
1586  PyArrayObject *nodeElementOffsets;
1587  PyArrayObject *elementNeighborsArray;
1588  PyArrayObject *elementBoundariesArray;
1589  PyArrayObject *elementBoundaryNodesArray;
1590  PyArrayObject *elementBoundaryElementsArray;
1592  PyArrayObject *interiorElementBoundariesArray;
1593  PyArrayObject *exteriorElementBoundariesArray;
1594  PyArrayObject *edgeNodesArray;
1595  PyArrayObject *nodeStarArray;
1596  PyArrayObject *nodeStarOffsets;
1597  PyArrayObject *elementMaterialTypes;
1598  PyArrayObject *elementBoundaryMaterialTypes;
1599  PyArrayObject *nodeMaterialTypes;
1600  PyArrayObject *nodeArray;
1601  int nx;
1602  int ny;
1603  int nz;
1604  int px;
1605  int py;
1606  int pz;
1607  PyArrayObject *elementIJK;
1608  PyArrayObject *weights;
1609  PyArrayObject *U_KNOT;
1610  PyArrayObject *V_KNOT;
1611  PyArrayObject *W_KNOT;
1612  PyArrayObject *elementDiametersArray;
1613  PyArrayObject *elementInnerDiametersArray;
1614  PyArrayObject *elementBoundaryDiametersArray;
1615  PyArrayObject *elementBarycentersArray;
1616  PyArrayObject *elementBoundaryBarycentersArray;
1617  PyArrayObject *nodeDiametersArray;
1618  PyArrayObject *nodeSupportArray;
1619  double h;
1620  double hMin;
1621  double sigmaMax;
1622  double volume;
1623 };
1624 
1625 
1626 /* "View.MemoryView":105
1627  *
1628  * @cname("__pyx_array")
1629  * cdef class array: # <<<<<<<<<<<<<<
1630  *
1631  * cdef:
1632  */
1633 struct __pyx_array_obj {
1634  PyObject_HEAD
1635  struct __pyx_vtabstruct_array *__pyx_vtab;
1636  char *data;
1637  Py_ssize_t len;
1638  char *format;
1639  int ndim;
1640  Py_ssize_t *_shape;
1641  Py_ssize_t *_strides;
1642  Py_ssize_t itemsize;
1643  PyObject *mode;
1644  PyObject *_format;
1645  void (*callback_free_data)(void *);
1646  int free_data;
1647  int dtype_is_object;
1648 };
1649 
1650 
1651 /* "View.MemoryView":279
1652  *
1653  * @cname('__pyx_MemviewEnum')
1654  * cdef class Enum(object): # <<<<<<<<<<<<<<
1655  * cdef object name
1656  * def __init__(self, name):
1657  */
1658 struct __pyx_MemviewEnum_obj {
1659  PyObject_HEAD
1660  PyObject *name;
1661 };
1662 
1663 
1664 /* "View.MemoryView":330
1665  *
1666  * @cname('__pyx_memoryview')
1667  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1668  *
1669  * cdef object obj
1670  */
1671 struct __pyx_memoryview_obj {
1672  PyObject_HEAD
1673  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1674  PyObject *obj;
1675  PyObject *_size;
1676  PyObject *_array_interface;
1677  PyThread_type_lock lock;
1678  __pyx_atomic_int acquisition_count[2];
1679  __pyx_atomic_int *acquisition_count_aligned_p;
1680  Py_buffer view;
1681  int flags;
1682  int dtype_is_object;
1683  __Pyx_TypeInfo *typeinfo;
1684 };
1685 
1686 
1687 /* "View.MemoryView":965
1688  *
1689  * @cname('__pyx_memoryviewslice')
1690  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1691  * "Internal class for passing memoryview slices to Python"
1692  *
1693  */
1694 struct __pyx_memoryviewslice_obj {
1695  struct __pyx_memoryview_obj __pyx_base;
1696  __Pyx_memviewslice from_slice;
1697  PyObject *from_object;
1698  PyObject *(*to_object_func)(char *);
1699  int (*to_dtype_func)(char *, PyObject *);
1700 };
1701 
1702 
1703 
1704 /* "View.MemoryView":105
1705  *
1706  * @cname("__pyx_array")
1707  * cdef class array: # <<<<<<<<<<<<<<
1708  *
1709  * cdef:
1710  */
1711 
1712 struct __pyx_vtabstruct_array {
1713  PyObject *(*get_memview)(struct __pyx_array_obj *);
1714 };
1715 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1716 
1717 
1718 /* "View.MemoryView":330
1719  *
1720  * @cname('__pyx_memoryview')
1721  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1722  *
1723  * cdef object obj
1724  */
1725 
1726 struct __pyx_vtabstruct_memoryview {
1727  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1728  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1729  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1730  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1731  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1732  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1733  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1734 };
1735 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1736 
1737 
1738 /* "View.MemoryView":965
1739  *
1740  * @cname('__pyx_memoryviewslice')
1741  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1742  * "Internal class for passing memoryview slices to Python"
1743  *
1744  */
1745 
1746 struct __pyx_vtabstruct__memoryviewslice {
1747  struct __pyx_vtabstruct_memoryview __pyx_base;
1748 };
1749 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1750 
1751 /* --- Runtime support code (head) --- */
1752 /* Refnanny.proto */
1753 #ifndef CYTHON_REFNANNY
1754  #define CYTHON_REFNANNY 0
1755 #endif
1756 #if CYTHON_REFNANNY
1757  typedef struct {
1758  void (*INCREF)(void*, PyObject*, int);
1759  void (*DECREF)(void*, PyObject*, int);
1760  void (*GOTREF)(void*, PyObject*, int);
1761  void (*GIVEREF)(void*, PyObject*, int);
1762  void* (*SetupContext)(const char*, int, const char*);
1763  void (*FinishContext)(void**);
1764  } __Pyx_RefNannyAPIStruct;
1765  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1766  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1767  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1768 #ifdef WITH_THREAD
1769  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1770  if (acquire_gil) {\
1771  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1772  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1773  PyGILState_Release(__pyx_gilstate_save);\
1774  } else {\
1775  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1776  }
1777 #else
1778  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1779  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1780 #endif
1781  #define __Pyx_RefNannyFinishContext()\
1782  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1783  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1784  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1785  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1786  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1787  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1788  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1789  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1790  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1791 #else
1792  #define __Pyx_RefNannyDeclarations
1793  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1794  #define __Pyx_RefNannyFinishContext()
1795  #define __Pyx_INCREF(r) Py_INCREF(r)
1796  #define __Pyx_DECREF(r) Py_DECREF(r)
1797  #define __Pyx_GOTREF(r)
1798  #define __Pyx_GIVEREF(r)
1799  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1800  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1801  #define __Pyx_XGOTREF(r)
1802  #define __Pyx_XGIVEREF(r)
1803 #endif
1804 #define __Pyx_XDECREF_SET(r, v) do {\
1805  PyObject *tmp = (PyObject *) r;\
1806  r = v; __Pyx_XDECREF(tmp);\
1807  } while (0)
1808 #define __Pyx_DECREF_SET(r, v) do {\
1809  PyObject *tmp = (PyObject *) r;\
1810  r = v; __Pyx_DECREF(tmp);\
1811  } while (0)
1812 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1813 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1814 
1815 /* RaiseArgTupleInvalid.proto */
1816 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1817  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1818 
1819 /* RaiseDoubleKeywords.proto */
1820 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1821 
1822 /* ParseKeywords.proto */
1823 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1824  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1825  const char* function_name);
1826 
1827 /* ArgTypeTest.proto */
1828 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1829  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1830  __Pyx__ArgTypeTest(obj, type, name, exact))
1831 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1832 
1833 /* PyObjectGetAttrStr.proto */
1834 #if CYTHON_USE_TYPE_SLOTS
1835 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1836 #else
1837 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1838 #endif
1839 
1840 /* GetBuiltinName.proto */
1841 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1842 
1843 /* PyDictVersioning.proto */
1844 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1845 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1846 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1847 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1848  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1849  (cache_var) = (value);
1850 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1851  static PY_UINT64_T __pyx_dict_version = 0;\
1852  static PyObject *__pyx_dict_cached_value = NULL;\
1853  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1854  (VAR) = __pyx_dict_cached_value;\
1855  } else {\
1856  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1857  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1858  }\
1859 }
1860 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1861 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1862 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1863 #else
1864 #define __PYX_GET_DICT_VERSION(dict) (0)
1865 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1866 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1867 #endif
1868 
1869 /* GetModuleGlobalName.proto */
1870 #if CYTHON_USE_DICT_VERSIONS
1871 #define __Pyx_GetModuleGlobalName(var, name) {\
1872  static PY_UINT64_T __pyx_dict_version = 0;\
1873  static PyObject *__pyx_dict_cached_value = NULL;\
1874  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1875  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1876  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1877 }
1878 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1879  PY_UINT64_T __pyx_dict_version;\
1880  PyObject *__pyx_dict_cached_value;\
1881  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1882 }
1883 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1884 #else
1885 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1886 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1887 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1888 #endif
1889 
1890 /* PyIntBinop.proto */
1891 #if !CYTHON_COMPILING_IN_PYPY
1892 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1893 #else
1894 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1895  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1896 #endif
1897 
1898 /* PyCFunctionFastCall.proto */
1899 #if CYTHON_FAST_PYCCALL
1900 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1901 #else
1902 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1903 #endif
1904 
1905 /* PyFunctionFastCall.proto */
1906 #if CYTHON_FAST_PYCALL
1907 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1908  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1909 #if 1 || PY_VERSION_HEX < 0x030600B1
1910 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1911 #else
1912 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1913 #endif
1914 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1915  (sizeof(char [1 - 2*!(cond)]) - 1)
1916 #ifndef Py_MEMBER_SIZE
1917 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1918 #endif
1919  static size_t __pyx_pyframe_localsplus_offset = 0;
1920  #include "frameobject.h"
1921  #define __Pxy_PyFrame_Initialize_Offsets()\
1922  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1923  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1924  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1925  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1926 #endif
1927 
1928 /* PyObjectCall.proto */
1929 #if CYTHON_COMPILING_IN_CPYTHON
1930 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1931 #else
1932 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1933 #endif
1934 
1935 /* PyObjectCall2Args.proto */
1936 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1937 
1938 /* PyObjectCallMethO.proto */
1939 #if CYTHON_COMPILING_IN_CPYTHON
1940 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1941 #endif
1942 
1943 /* PyObjectCallOneArg.proto */
1944 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1945 
1946 /* PyObjectCallNoArg.proto */
1947 #if CYTHON_COMPILING_IN_CPYTHON
1948 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1949 #else
1950 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1951 #endif
1952 
1953 /* GetTopmostException.proto */
1954 #if CYTHON_USE_EXC_INFO_STACK
1955 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1956 #endif
1957 
1958 /* PyThreadStateGet.proto */
1959 #if CYTHON_FAST_THREAD_STATE
1960 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1961 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1962 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1963 #else
1964 #define __Pyx_PyThreadState_declare
1965 #define __Pyx_PyThreadState_assign
1966 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1967 #endif
1968 
1969 /* SaveResetException.proto */
1970 #if CYTHON_FAST_THREAD_STATE
1971 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1972 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1973 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1974 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1975 #else
1976 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1977 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1978 #endif
1979 
1980 /* PyErrExceptionMatches.proto */
1981 #if CYTHON_FAST_THREAD_STATE
1982 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1983 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1984 #else
1985 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1986 #endif
1987 
1988 /* GetException.proto */
1989 #if CYTHON_FAST_THREAD_STATE
1990 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1991 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1992 #else
1993 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1994 #endif
1995 
1996 /* PyErrFetchRestore.proto */
1997 #if CYTHON_FAST_THREAD_STATE
1998 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1999 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2000 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2001 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2002 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2003 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2004 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2005 #if CYTHON_COMPILING_IN_CPYTHON
2006 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2007 #else
2008 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2009 #endif
2010 #else
2011 #define __Pyx_PyErr_Clear() PyErr_Clear()
2012 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2013 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2014 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2015 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2016 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2017 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2018 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2019 #endif
2020 
2021 /* RaiseException.proto */
2022 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2023 
2024 /* IncludeStringH.proto */
2025 #include <string.h>
2026 
2027 /* BytesEquals.proto */
2028 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2029 
2030 /* UnicodeEquals.proto */
2031 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2032 
2033 /* StrEquals.proto */
2034 #if PY_MAJOR_VERSION >= 3
2035 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2036 #else
2037 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2038 #endif
2039 
2040 /* None.proto */
2041 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2042 
2043 /* UnaryNegOverflows.proto */
2044 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2045  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2046 
2047 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2048 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2049 /* GetAttr.proto */
2050 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2051 
2052 /* GetItemInt.proto */
2053 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2054  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2055  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2056  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2057  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2058 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2059  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2060  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2061  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2062 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2063  int wraparound, int boundscheck);
2064 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2065  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2066  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2067  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2068 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2069  int wraparound, int boundscheck);
2070 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2071 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2072  int is_list, int wraparound, int boundscheck);
2073 
2074 /* ObjectGetItem.proto */
2075 #if CYTHON_USE_TYPE_SLOTS
2076 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2077 #else
2078 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2079 #endif
2080 
2081 /* decode_c_string_utf16.proto */
2082 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2083  int byteorder = 0;
2084  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2085 }
2086 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2087  int byteorder = -1;
2088  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2089 }
2090 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2091  int byteorder = 1;
2092  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2093 }
2094 
2095 /* decode_c_string.proto */
2096 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2097  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2098  const char* encoding, const char* errors,
2099  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2100 
2101 /* GetAttr3.proto */
2102 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2103 
2104 /* RaiseTooManyValuesToUnpack.proto */
2105 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2106 
2107 /* RaiseNeedMoreValuesToUnpack.proto */
2108 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2109 
2110 /* RaiseNoneIterError.proto */
2111 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2112 
2113 /* ExtTypeTest.proto */
2114 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2115 
2116 /* SwapException.proto */
2117 #if CYTHON_FAST_THREAD_STATE
2118 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2119 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2120 #else
2121 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2122 #endif
2123 
2124 /* Import.proto */
2125 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2126 
2127 /* FastTypeChecks.proto */
2128 #if CYTHON_COMPILING_IN_CPYTHON
2129 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2130 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2131 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2132 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2133 #else
2134 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2135 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2136 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2137 #endif
2138 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2139 
2140 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2141 /* ListCompAppend.proto */
2142 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2143 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2144  PyListObject* L = (PyListObject*) list;
2145  Py_ssize_t len = Py_SIZE(list);
2146  if (likely(L->allocated > len)) {
2147  Py_INCREF(x);
2148  PyList_SET_ITEM(list, len, x);
2149  __Pyx_SET_SIZE(list, len + 1);
2150  return 0;
2151  }
2152  return PyList_Append(list, x);
2153 }
2154 #else
2155 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2156 #endif
2157 
2158 /* ListExtend.proto */
2159 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2160 #if CYTHON_COMPILING_IN_CPYTHON
2161  PyObject* none = _PyList_Extend((PyListObject*)L, v);
2162  if (unlikely(!none))
2163  return -1;
2164  Py_DECREF(none);
2165  return 0;
2166 #else
2167  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2168 #endif
2169 }
2170 
2171 /* ListAppend.proto */
2172 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2173 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2174  PyListObject* L = (PyListObject*) list;
2175  Py_ssize_t len = Py_SIZE(list);
2176  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2177  Py_INCREF(x);
2178  PyList_SET_ITEM(list, len, x);
2179  __Pyx_SET_SIZE(list, len + 1);
2180  return 0;
2181  }
2182  return PyList_Append(list, x);
2183 }
2184 #else
2185 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2186 #endif
2187 
2188 /* None.proto */
2189 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2190 
2191 /* None.proto */
2192 static CYTHON_INLINE long __Pyx_div_long(long, long);
2193 
2194 /* ImportFrom.proto */
2195 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2196 
2197 /* HasAttr.proto */
2198 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2199 
2200 /* StringJoin.proto */
2201 #if PY_MAJOR_VERSION < 3
2202 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
2203 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
2204 #else
2205 #define __Pyx_PyString_Join PyUnicode_Join
2206 #define __Pyx_PyBaseString_Join PyUnicode_Join
2207 #endif
2208 #if CYTHON_COMPILING_IN_CPYTHON
2209  #if PY_MAJOR_VERSION < 3
2210  #define __Pyx_PyBytes_Join _PyString_Join
2211  #else
2212  #define __Pyx_PyBytes_Join _PyBytes_Join
2213  #endif
2214 #else
2215 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
2216 #endif
2217 
2218 /* PyObject_Unicode.proto */
2219 #if PY_MAJOR_VERSION >= 3
2220 #define __Pyx_PyObject_Unicode(obj)\
2221  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2222 #else
2223 #define __Pyx_PyObject_Unicode(obj)\
2224  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
2225 #endif
2226 
2227 /* PyObject_GenericGetAttrNoDict.proto */
2228 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2229 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2230 #else
2231 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2232 #endif
2233 
2234 /* PyObject_GenericGetAttr.proto */
2235 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2236 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2237 #else
2238 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2239 #endif
2240 
2241 /* SetVTable.proto */
2242 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2243 
2244 /* PyObjectGetAttrStrNoError.proto */
2245 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2246 
2247 /* SetupReduce.proto */
2248 static int __Pyx_setup_reduce(PyObject* type_obj);
2249 
2250 /* TypeImport.proto */
2251 #ifndef __PYX_HAVE_RT_ImportType_proto
2252 #define __PYX_HAVE_RT_ImportType_proto
2253 enum __Pyx_ImportType_CheckSize {
2254  __Pyx_ImportType_CheckSize_Error = 0,
2255  __Pyx_ImportType_CheckSize_Warn = 1,
2256  __Pyx_ImportType_CheckSize_Ignore = 2
2257 };
2258 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2259 #endif
2260 
2261 /* CLineInTraceback.proto */
2262 #ifdef CYTHON_CLINE_IN_TRACEBACK
2263 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2264 #else
2265 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2266 #endif
2267 
2268 /* CodeObjectCache.proto */
2269 typedef struct {
2270  PyCodeObject* code_object;
2271  int code_line;
2272 } __Pyx_CodeObjectCacheEntry;
2273 struct __Pyx_CodeObjectCache {
2274  int count;
2275  int max_count;
2276  __Pyx_CodeObjectCacheEntry* entries;
2277 };
2278 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2279 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2280 static PyCodeObject *__pyx_find_code_object(int code_line);
2281 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2282 
2283 /* AddTraceback.proto */
2284 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2285  int py_line, const char *filename);
2286 
2287 /* GCCDiagnostics.proto */
2288 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2289 #define __Pyx_HAS_GCC_DIAGNOSTIC
2290 #endif
2291 
2292 /* MemviewDtypeToObject.proto */
2293 static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp);
2294 static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj);
2295 
2296 /* RealImag.proto */
2297 #if CYTHON_CCOMPLEX
2298  #ifdef __cplusplus
2299  #define __Pyx_CREAL(z) ((z).real())
2300  #define __Pyx_CIMAG(z) ((z).imag())
2301  #else
2302  #define __Pyx_CREAL(z) (__real__(z))
2303  #define __Pyx_CIMAG(z) (__imag__(z))
2304  #endif
2305 #else
2306  #define __Pyx_CREAL(z) ((z).real)
2307  #define __Pyx_CIMAG(z) ((z).imag)
2308 #endif
2309 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2310  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2311  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2312  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2313 #else
2314  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2315  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2316 #endif
2317 
2318 /* Arithmetic.proto */
2319 #if CYTHON_CCOMPLEX
2320  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2321  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2322  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2323  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2324  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2325  #define __Pyx_c_neg_float(a) (-(a))
2326  #ifdef __cplusplus
2327  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2328  #define __Pyx_c_conj_float(z) (::std::conj(z))
2329  #if 1
2330  #define __Pyx_c_abs_float(z) (::std::abs(z))
2331  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2332  #endif
2333  #else
2334  #define __Pyx_c_is_zero_float(z) ((z)==0)
2335  #define __Pyx_c_conj_float(z) (conjf(z))
2336  #if 1
2337  #define __Pyx_c_abs_float(z) (cabsf(z))
2338  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2339  #endif
2340  #endif
2341 #else
2342  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2343  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2344  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2345  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2346  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2347  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2348  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2349  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2350  #if 1
2351  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2352  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2353  #endif
2354 #endif
2355 
2356 /* Arithmetic.proto */
2357 #if CYTHON_CCOMPLEX
2358  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2359  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2360  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2361  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2362  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2363  #define __Pyx_c_neg_double(a) (-(a))
2364  #ifdef __cplusplus
2365  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2366  #define __Pyx_c_conj_double(z) (::std::conj(z))
2367  #if 1
2368  #define __Pyx_c_abs_double(z) (::std::abs(z))
2369  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2370  #endif
2371  #else
2372  #define __Pyx_c_is_zero_double(z) ((z)==0)
2373  #define __Pyx_c_conj_double(z) (conj(z))
2374  #if 1
2375  #define __Pyx_c_abs_double(z) (cabs(z))
2376  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2377  #endif
2378  #endif
2379 #else
2380  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2381  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2382  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2383  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2384  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2385  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2386  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2387  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2388  #if 1
2389  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2390  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2391  #endif
2392 #endif
2393 
2394 #if PY_MAJOR_VERSION < 3
2395  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2396  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2397 #else
2398  #define __Pyx_GetBuffer PyObject_GetBuffer
2399  #define __Pyx_ReleaseBuffer PyBuffer_Release
2400 #endif
2401 
2402 
2403 /* BufferStructDeclare.proto */
2404 typedef struct {
2405  Py_ssize_t shape, strides, suboffsets;
2406 } __Pyx_Buf_DimInfo;
2407 typedef struct {
2408  size_t refcount;
2409  Py_buffer pybuffer;
2410 } __Pyx_Buffer;
2411 typedef struct {
2412  __Pyx_Buffer *rcbuffer;
2413  char *data;
2414  __Pyx_Buf_DimInfo diminfo[8];
2415 } __Pyx_LocalBuf_ND;
2416 
2417 /* MemviewSliceIsContig.proto */
2418 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2419 
2420 /* OverlappingSlices.proto */
2421 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2422  __Pyx_memviewslice *slice2,
2423  int ndim, size_t itemsize);
2424 
2425 /* Capsule.proto */
2426 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2427 
2428 /* CIntFromPy.proto */
2429 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2430 
2431 /* CIntToPy.proto */
2432 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2433 
2434 /* TypeInfoToFormat.proto */
2435 struct __pyx_typeinfo_string {
2436  char string[3];
2437 };
2438 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
2439 
2440 /* MemviewSliceCopyTemplate.proto */
2441 static __Pyx_memviewslice
2442 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2443  const char *mode, int ndim,
2444  size_t sizeof_dtype, int contig_flag,
2445  int dtype_is_object);
2446 
2447 /* MemviewSliceInit.proto */
2448 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2449 #define __Pyx_MEMVIEW_DIRECT 1
2450 #define __Pyx_MEMVIEW_PTR 2
2451 #define __Pyx_MEMVIEW_FULL 4
2452 #define __Pyx_MEMVIEW_CONTIG 8
2453 #define __Pyx_MEMVIEW_STRIDED 16
2454 #define __Pyx_MEMVIEW_FOLLOW 32
2455 #define __Pyx_IS_C_CONTIG 1
2456 #define __Pyx_IS_F_CONTIG 2
2457 static int __Pyx_init_memviewslice(
2458  struct __pyx_memoryview_obj *memview,
2459  int ndim,
2460  __Pyx_memviewslice *memviewslice,
2461  int memview_is_new_reference);
2462 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
2463  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2464 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
2465  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2466 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2467 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2468 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2469 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2470 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
2471 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
2472 
2473 /* CIntFromPy.proto */
2474 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2475 
2476 /* CIntToPy.proto */
2477 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2478 
2479 /* CIntFromPy.proto */
2480 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2481 
2482 /* CheckBinaryVersion.proto */
2483 static int __Pyx_check_binary_version(void);
2484 
2485 /* InitStrings.proto */
2486 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2487 
2488 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2489 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2490 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2491 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2492 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2493 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2494 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2495 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2496 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2497 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2498 
2499 /* Module declarations from 'cpython.buffer' */
2500 
2501 /* Module declarations from 'libc.string' */
2502 
2503 /* Module declarations from 'libc.stdio' */
2504 
2505 /* Module declarations from '__builtin__' */
2506 
2507 /* Module declarations from 'cpython.type' */
2508 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2509 
2510 /* Module declarations from 'cpython' */
2511 
2512 /* Module declarations from 'cpython.object' */
2513 
2514 /* Module declarations from 'cpython.ref' */
2515 
2516 /* Module declarations from 'cpython.mem' */
2517 
2518 /* Module declarations from 'numpy' */
2519 
2520 /* Module declarations from 'numpy' */
2521 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2522 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2523 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2524 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2525 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2526 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2527 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2528 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2529 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2530 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2531 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2532 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2533 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2534 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2535 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2536 
2537 /* Module declarations from 'mpi4py.libmpi' */
2538 
2539 /* Module declarations from 'mpi4py.MPI' */
2540 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Status = 0;
2541 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Datatype = 0;
2542 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Request = 0;
2543 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Prequest = 0;
2544 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Grequest = 0;
2545 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Message = 0;
2546 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Op = 0;
2547 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Group = 0;
2548 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Info = 0;
2549 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Errhandler = 0;
2550 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Comm = 0;
2551 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Intracomm = 0;
2552 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Topocomm = 0;
2553 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Cartcomm = 0;
2554 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Graphcomm = 0;
2555 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Distgraphcomm = 0;
2556 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Intercomm = 0;
2557 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Win = 0;
2558 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_File = 0;
2559 
2560 /* Module declarations from 'libcpp' */
2561 
2562 /* Module declarations from 'mesh' */
2563 
2564 /* Module declarations from 'proteus' */
2565 
2566 /* Module declarations from 'proteus.mesh' */
2567 
2568 /* Module declarations from 'proteus.cmeshTools' */
2569 static PyTypeObject *__pyx_ptype_7proteus_10cmeshTools_CMesh = 0;
2570 
2571 /* Module declarations from 'proteus.partitioning' */
2572 
2573 /* Module declarations from 'cpartitioning' */
2574 static PyTypeObject *__pyx_array_type = 0;
2575 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2576 static PyTypeObject *__pyx_memoryview_type = 0;
2577 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2578 static PyObject *generic = 0;
2579 static PyObject *strided = 0;
2580 static PyObject *indirect = 0;
2581 static PyObject *contiguous = 0;
2582 static PyObject *indirect_contiguous = 0;
2583 static int __pyx_memoryview_thread_locks_used;
2584 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2585 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2586 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2587 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2588 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2589 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2590 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2591 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2592 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2593 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2594 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2595 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2596 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2597 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2598 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2599 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2600 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2601 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2602 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2603 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2604 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2605 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2606 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2607 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2608 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2609 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2610 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2611 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2612 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2613 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2614 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2615 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2616 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2617 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2618 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/
2619 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2620 #define __Pyx_MODULE_NAME "cpartitioning"
2621 extern int __pyx_module_is_main_cpartitioning;
2622 int __pyx_module_is_main_cpartitioning = 0;
2623 
2624 /* Implementation of 'cpartitioning' */
2625 static PyObject *__pyx_builtin_ImportError;
2626 static PyObject *__pyx_builtin_ValueError;
2627 static PyObject *__pyx_builtin_MemoryError;
2628 static PyObject *__pyx_builtin_enumerate;
2629 static PyObject *__pyx_builtin_range;
2630 static PyObject *__pyx_builtin_TypeError;
2631 static PyObject *__pyx_builtin_Ellipsis;
2632 static PyObject *__pyx_builtin_id;
2633 static PyObject *__pyx_builtin_IndexError;
2634 static const char __pyx_k_O[] = "O";
2635 static const char __pyx_k_T[] = "T{";
2636  static const char __pyx_k_c[] = "c";
2637  static const char __pyx_k_s[] = "(%s)";
2638  static const char __pyx_k_id[] = "id";
2639  static const char __pyx_k_np[] = "np";
2640  static const char __pyx_k__21[] = "^";
2641  static const char __pyx_k__22[] = "";
2642  static const char __pyx_k__23[] = ":";
2643 static const char __pyx_k__24[] = "}";
2644 static const char __pyx_k__25[] = ",";
2645 static const char __pyx_k_new[] = "__new__";
2646 static const char __pyx_k_obj[] = "obj";
2647 static const char __pyx_k_Comm[] = "Comm";
2648 static const char __pyx_k_base[] = "base";
2649 static const char __pyx_k_comm[] = "comm";
2650 static const char __pyx_k_dict[] = "__dict__";
2651 static const char __pyx_k_join[] = "join";
2652 static const char __pyx_k_main[] = "__main__";
2653 static const char __pyx_k_mode[] = "mode";
2654 static const char __pyx_k_name[] = "name";
2655 static const char __pyx_k_ndim[] = "ndim";
2656 static const char __pyx_k_pack[] = "pack";
2657 static const char __pyx_k_size[] = "size";
2658 static const char __pyx_k_step[] = "step";
2659 static const char __pyx_k_stop[] = "stop";
2660 static const char __pyx_k_test[] = "__test__";
2661 static const char __pyx_k_ASCII[] = "ASCII";
2662 static const char __pyx_k_class[] = "__class__";
2663 static const char __pyx_k_cmesh[] = "cmesh";
2664 static const char __pyx_k_error[] = "error";
2665 static const char __pyx_k_flags[] = "flags";
2666 static const char __pyx_k_numpy[] = "numpy";
2667 static const char __pyx_k_range[] = "range";
2668 static const char __pyx_k_shape[] = "shape";
2669 static const char __pyx_k_start[] = "start";
2670 static const char __pyx_k_encode[] = "encode";
2671 static const char __pyx_k_format[] = "format";
2672 static const char __pyx_k_import[] = "__import__";
2673 static const char __pyx_k_nSpace[] = "nSpace";
2674 static const char __pyx_k_name_2[] = "__name__";
2675 static const char __pyx_k_pickle[] = "pickle";
2676 static const char __pyx_k_reduce[] = "__reduce__";
2677 static const char __pyx_k_struct[] = "struct";
2678 static const char __pyx_k_unpack[] = "unpack";
2679 static const char __pyx_k_update[] = "update";
2680 static const char __pyx_k_asarray[] = "asarray";
2681 static const char __pyx_k_fortran[] = "fortran";
2682 static const char __pyx_k_memview[] = "memview";
2683 static const char __pyx_k_proteus[] = "proteus";
2684 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2685 static const char __pyx_k_filebase[] = "filebase";
2686 static const char __pyx_k_getstate[] = "__getstate__";
2687 static const char __pyx_k_itemsize[] = "itemsize";
2688 static const char __pyx_k_pyx_type[] = "__pyx_type";
2689 static const char __pyx_k_setstate[] = "__setstate__";
2690 static const char __pyx_k_TypeError[] = "TypeError";
2691 static const char __pyx_k_enumerate[] = "enumerate";
2692 static const char __pyx_k_indexBase[] = "indexBase";
2693 static const char __pyx_k_pyx_state[] = "__pyx_state";
2694 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2695 static const char __pyx_k_IndexError[] = "IndexError";
2696 static const char __pyx_k_ValueError[] = "ValueError";
2697 static const char __pyx_k_pyx_result[] = "__pyx_result";
2698 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2699 static const char __pyx_k_ImportError[] = "ImportError";
2700 static const char __pyx_k_MemoryError[] = "MemoryError";
2701 static const char __pyx_k_PickleError[] = "PickleError";
2702 static const char __pyx_k_nDOF_element[] = "nDOF_element";
2703 static const char __pyx_k_proteus_Comm[] = "proteus_Comm";
2704 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2705 static const char __pyx_k_stringsource[] = "stringsource";
2706 static const char __pyx_k_cpartitioning[] = "cpartitioning";
2707 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2708 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2709 static const char __pyx_k_nDOF_subdomain[] = "nDOF_subdomain";
2710 static const char __pyx_k_partitionNodes[] = "partitionNodes";
2711 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2712 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2713 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2714 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2715 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2716 static const char __pyx_k_subdomain_cmesh[] = "subdomain_cmesh";
2717 static const char __pyx_k_dg_subdomain_l2g[] = "dg_subdomain_l2g";
2718 static const char __pyx_k_nLayersOfOverlap[] = "nLayersOfOverlap";
2719 static const char __pyx_k_max_dof_neighbors[] = "max_dof_neighbors";
2720 static const char __pyx_k_partitionElements[] = "partitionElements";
2721 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2722 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2723 static const char __pyx_k_nDOF_all_processes[] = "nDOF_all_processes";
2724 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2725 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2726 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2727 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2728 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2729 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2730 static const char __pyx_k_quadratic_lagrangeNodes[] = "quadratic_lagrangeNodes";
2731 static const char __pyx_k_quadratic_subdomain_l2g[] = "quadratic_subdomain_l2g";
2732 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2733 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2734 static const char __pyx_k_proteus_cpartitioning_pyx[] = "proteus/cpartitioning.pyx";
2735 static const char __pyx_k_edgeOffsets_subdomain_owned[] = "edgeOffsets_subdomain_owned";
2736 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2737 static const char __pyx_k_nodeOffsets_subdomain_owned[] = "nodeOffsets_subdomain_owned";
2738 static const char __pyx_k_convertPUMIPartitionToPython[] = "convertPUMIPartitionToPython";
2739 static const char __pyx_k_dgNumbering_subdomain2global[] = "dgNumbering_subdomain2global";
2740 static const char __pyx_k_partitionNodesFromTetgenFiles[] = "partitionNodesFromTetgenFiles";
2741 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2742 static const char __pyx_k_dg_dof_offsets_subdomain_owned[] = "dg_dof_offsets_subdomain_owned";
2743 static const char __pyx_k_edgeNumbering_subdomain2global[] = "edgeNumbering_subdomain2global";
2744 static const char __pyx_k_elementOffsets_subdomain_owned[] = "elementOffsets_subdomain_owned";
2745 static const char __pyx_k_nodeNumbering_subdomain2global[] = "nodeNumbering_subdomain2global";
2746 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2747 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2748 static const char __pyx_k_partitionNodesFromTriangleFiles[] = "partitionNodesFromTriangleFiles";
2749 static const char __pyx_k_quadratic_dof_offsets_subdomain[] = "quadratic_dof_offsets_subdomain_owned";
2750 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2751 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2752 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2753 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2754 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2755 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2756 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2757 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2758 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2759 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2760 static const char __pyx_k_buildDiscontinuousGalerkinLocal2[] = "buildDiscontinuousGalerkinLocal2GlobalMappings";
2761 static const char __pyx_k_buildQuadraticCubeLocal2GlobalMa[] = "buildQuadraticCubeLocal2GlobalMappings";
2762 static const char __pyx_k_buildQuadraticCubeSubdomain2Glob[] = "buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!";
2763 static const char __pyx_k_buildQuadraticLocal2GlobalMappin[] = "buildQuadraticLocal2GlobalMappings";
2764 static const char __pyx_k_elementBoundaryNumbering_subdoma[] = "elementBoundaryNumbering_subdomain2global";
2765 static const char __pyx_k_elementBoundaryOffsets_subdomain[] = "elementBoundaryOffsets_subdomain_owned";
2766 static const char __pyx_k_elementNumbering_subdomain2globa[] = "elementNumbering_subdomain2global";
2767 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2768 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2769 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2770 static const char __pyx_k_quadraticNumbering_subdomain2glo[] = "quadraticNumbering_subdomain2global";
2771 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2772 static const char __pyx_k_buildQuadraticCubeSubdomain2Glob_2[] = "buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!";
2773 static PyObject *__pyx_n_s_ASCII;
2774 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2775 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2776 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2777 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2778 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2779 static PyObject *__pyx_n_s_Comm;
2780 static PyObject *__pyx_n_s_Ellipsis;
2781 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2782 static PyObject *__pyx_n_s_ImportError;
2783 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2784 static PyObject *__pyx_n_s_IndexError;
2785 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2786 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2787 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2788 static PyObject *__pyx_n_s_MemoryError;
2789 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2790 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2791 static PyObject *__pyx_n_b_O;
2792 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2793 static PyObject *__pyx_n_s_PickleError;
2794 static PyObject *__pyx_kp_b_T;
2795 static PyObject *__pyx_n_s_TypeError;
2796 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2797 static PyObject *__pyx_n_s_ValueError;
2798 static PyObject *__pyx_n_s_View_MemoryView;
2799 static PyObject *__pyx_kp_b__21;
2800 static PyObject *__pyx_kp_b__22;
2801 static PyObject *__pyx_kp_b__23;
2802 static PyObject *__pyx_kp_b__24;
2803 static PyObject *__pyx_kp_u__25;
2804 static PyObject *__pyx_n_s_allocate_buffer;
2805 static PyObject *__pyx_n_s_asarray;
2806 static PyObject *__pyx_n_s_base;
2807 static PyObject *__pyx_n_s_buildDiscontinuousGalerkinLocal2;
2808 static PyObject *__pyx_n_s_buildQuadraticCubeLocal2GlobalMa;
2809 static PyObject *__pyx_kp_s_buildQuadraticCubeSubdomain2Glob;
2810 static PyObject *__pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2;
2811 static PyObject *__pyx_n_s_buildQuadraticLocal2GlobalMappin;
2812 static PyObject *__pyx_n_s_c;
2813 static PyObject *__pyx_n_u_c;
2814 static PyObject *__pyx_n_s_class;
2815 static PyObject *__pyx_n_s_cline_in_traceback;
2816 static PyObject *__pyx_n_s_cmesh;
2817 static PyObject *__pyx_n_s_comm;
2818 static PyObject *__pyx_kp_s_contiguous_and_direct;
2819 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2820 static PyObject *__pyx_n_s_convertPUMIPartitionToPython;
2821 static PyObject *__pyx_n_s_cpartitioning;
2822 static PyObject *__pyx_n_s_dgNumbering_subdomain2global;
2823 static PyObject *__pyx_n_s_dg_dof_offsets_subdomain_owned;
2824 static PyObject *__pyx_n_s_dg_subdomain_l2g;
2825 static PyObject *__pyx_n_s_dict;
2826 static PyObject *__pyx_n_s_dtype_is_object;
2827 static PyObject *__pyx_n_s_edgeNumbering_subdomain2global;
2828 static PyObject *__pyx_n_s_edgeOffsets_subdomain_owned;
2829 static PyObject *__pyx_n_s_elementBoundaryNumbering_subdoma;
2830 static PyObject *__pyx_n_s_elementBoundaryOffsets_subdomain;
2831 static PyObject *__pyx_n_s_elementNumbering_subdomain2globa;
2832 static PyObject *__pyx_n_s_elementOffsets_subdomain_owned;
2833 static PyObject *__pyx_n_s_encode;
2834 static PyObject *__pyx_n_s_enumerate;
2835 static PyObject *__pyx_n_s_error;
2836 static PyObject *__pyx_n_s_filebase;
2837 static PyObject *__pyx_n_s_flags;
2838 static PyObject *__pyx_n_s_format;
2839 static PyObject *__pyx_n_s_fortran;
2840 static PyObject *__pyx_n_u_fortran;
2841 static PyObject *__pyx_n_s_getstate;
2842 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2843 static PyObject *__pyx_n_s_id;
2844 static PyObject *__pyx_n_s_import;
2845 static PyObject *__pyx_n_s_indexBase;
2846 static PyObject *__pyx_n_s_itemsize;
2847 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2848 static PyObject *__pyx_n_s_join;
2849 static PyObject *__pyx_n_s_main;
2850 static PyObject *__pyx_n_s_max_dof_neighbors;
2851 static PyObject *__pyx_n_s_memview;
2852 static PyObject *__pyx_n_s_mode;
2853 static PyObject *__pyx_n_s_nDOF_all_processes;
2854 static PyObject *__pyx_n_s_nDOF_element;
2855 static PyObject *__pyx_n_s_nDOF_subdomain;
2856 static PyObject *__pyx_n_s_nLayersOfOverlap;
2857 static PyObject *__pyx_n_s_nSpace;
2858 static PyObject *__pyx_n_s_name;
2859 static PyObject *__pyx_n_s_name_2;
2860 static PyObject *__pyx_n_s_ndim;
2861 static PyObject *__pyx_n_s_new;
2862 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2863 static PyObject *__pyx_n_s_nodeNumbering_subdomain2global;
2864 static PyObject *__pyx_n_s_nodeOffsets_subdomain_owned;
2865 static PyObject *__pyx_n_s_np;
2866 static PyObject *__pyx_n_s_numpy;
2867 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2868 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2869 static PyObject *__pyx_n_s_obj;
2870 static PyObject *__pyx_n_s_pack;
2871 static PyObject *__pyx_n_s_partitionElements;
2872 static PyObject *__pyx_n_s_partitionNodes;
2873 static PyObject *__pyx_n_s_partitionNodesFromTetgenFiles;
2874 static PyObject *__pyx_n_s_partitionNodesFromTriangleFiles;
2875 static PyObject *__pyx_n_s_pickle;
2876 static PyObject *__pyx_n_s_proteus;
2877 static PyObject *__pyx_n_s_proteus_Comm;
2878 static PyObject *__pyx_kp_s_proteus_cpartitioning_pyx;
2879 static PyObject *__pyx_n_s_pyx_PickleError;
2880 static PyObject *__pyx_n_s_pyx_checksum;
2881 static PyObject *__pyx_n_s_pyx_getbuffer;
2882 static PyObject *__pyx_n_s_pyx_result;
2883 static PyObject *__pyx_n_s_pyx_state;
2884 static PyObject *__pyx_n_s_pyx_type;
2885 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2886 static PyObject *__pyx_n_s_pyx_vtable;
2887 static PyObject *__pyx_n_s_quadraticNumbering_subdomain2glo;
2888 static PyObject *__pyx_n_s_quadratic_dof_offsets_subdomain;
2889 static PyObject *__pyx_n_s_quadratic_lagrangeNodes;
2890 static PyObject *__pyx_n_s_quadratic_subdomain_l2g;
2891 static PyObject *__pyx_n_s_range;
2892 static PyObject *__pyx_n_s_reduce;
2893 static PyObject *__pyx_n_s_reduce_cython;
2894 static PyObject *__pyx_n_s_reduce_ex;
2895 static PyObject *__pyx_kp_u_s;
2896 static PyObject *__pyx_n_s_setstate;
2897 static PyObject *__pyx_n_s_setstate_cython;
2898 static PyObject *__pyx_n_s_shape;
2899 static PyObject *__pyx_n_s_size;
2900 static PyObject *__pyx_n_s_start;
2901 static PyObject *__pyx_n_s_step;
2902 static PyObject *__pyx_n_s_stop;
2903 static PyObject *__pyx_kp_s_strided_and_direct;
2904 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2905 static PyObject *__pyx_kp_s_strided_and_indirect;
2906 static PyObject *__pyx_kp_s_stringsource;
2907 static PyObject *__pyx_n_s_struct;
2908 static PyObject *__pyx_n_s_subdomain_cmesh;
2909 static PyObject *__pyx_n_s_test;
2910 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2911 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2912 static PyObject *__pyx_n_s_unpack;
2913 static PyObject *__pyx_n_s_update;
2914 static PyObject *__pyx_pf_13cpartitioning_partitionElements(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
2915 static PyObject *__pyx_pf_13cpartitioning_2partitionNodes(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
2916 static PyObject *__pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct PyMPICommObject *__pyx_v_comm, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
2917 static PyObject *__pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase, int __pyx_v_indexBase, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
2918 static PyObject *__pyx_pf_13cpartitioning_8partitionNodesFromTriangleFiles(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase, int __pyx_v_indexBase, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
2919 static PyObject *__pyx_pf_13cpartitioning_10buildQuadraticLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes); /* proto */
2920 static PyObject *__pyx_pf_13cpartitioning_12buildQuadraticCubeLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes); /* proto */
2921 static PyObject *__pyx_pf_13cpartitioning_14buildDiscontinuousGalerkinLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nDOF_element, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_dg_subdomain_l2g, PyArrayObject *__pyx_v_dgNumbering_subdomain2global); /* proto */
2922 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2923 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2924 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2925 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2926 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2927 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2928 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2929 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2930 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2931 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2932 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2933 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2934 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2935 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2936 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2937 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2938 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2939 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2940 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2941 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2942 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2943 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2944 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2945 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2946 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2947 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2948 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2949 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2950 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2951 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2952 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2953 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2954 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2955 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2956 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2957 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2958 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2959 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2960 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2961 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2962 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2963 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2964 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2965 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2966 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2967 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2968 static PyObject *__pyx_int_0;
2969 static PyObject *__pyx_int_1;
2970 static PyObject *__pyx_int_184977713;
2971 static PyObject *__pyx_int_neg_1;
2972 static PyObject *__pyx_tuple_;
2973 static PyObject *__pyx_tuple__2;
2974 static PyObject *__pyx_tuple__3;
2975 static PyObject *__pyx_tuple__4;
2976 static PyObject *__pyx_tuple__5;
2977 static PyObject *__pyx_tuple__6;
2978 static PyObject *__pyx_tuple__7;
2979 static PyObject *__pyx_tuple__8;
2980 static PyObject *__pyx_tuple__9;
2981 static PyObject *__pyx_slice__17;
2982 static PyObject *__pyx_tuple__10;
2983 static PyObject *__pyx_tuple__11;
2984 static PyObject *__pyx_tuple__12;
2985 static PyObject *__pyx_tuple__13;
2986 static PyObject *__pyx_tuple__14;
2987 static PyObject *__pyx_tuple__15;
2988 static PyObject *__pyx_tuple__16;
2989 static PyObject *__pyx_tuple__18;
2990 static PyObject *__pyx_tuple__19;
2991 static PyObject *__pyx_tuple__20;
2992 static PyObject *__pyx_tuple__26;
2993 static PyObject *__pyx_tuple__28;
2994 static PyObject *__pyx_tuple__30;
2995 static PyObject *__pyx_tuple__32;
2996 static PyObject *__pyx_tuple__34;
2997 static PyObject *__pyx_tuple__36;
2998 static PyObject *__pyx_tuple__38;
2999 static PyObject *__pyx_tuple__40;
3000 static PyObject *__pyx_tuple__42;
3001 static PyObject *__pyx_tuple__43;
3002 static PyObject *__pyx_tuple__44;
3003 static PyObject *__pyx_tuple__45;
3004 static PyObject *__pyx_tuple__46;
3005 static PyObject *__pyx_tuple__47;
3006 static PyObject *__pyx_codeobj__27;
3007 static PyObject *__pyx_codeobj__29;
3008 static PyObject *__pyx_codeobj__31;
3009 static PyObject *__pyx_codeobj__33;
3010 static PyObject *__pyx_codeobj__35;
3011 static PyObject *__pyx_codeobj__37;
3012 static PyObject *__pyx_codeobj__39;
3013 static PyObject *__pyx_codeobj__41;
3014 static PyObject *__pyx_codeobj__48;
3015 /* Late includes */
3016 
3017 /* "cpartitioning.pyx":20
3018  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
3019  *
3020  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3021  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3022  * c_partitionElements(comm.ob_mpi,
3023  */
3024 
3025 /* Python wrapper */
3026 static PyObject *__pyx_pw_13cpartitioning_1partitionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3027 static PyMethodDef __pyx_mdef_13cpartitioning_1partitionElements = {"partitionElements", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_1partitionElements, METH_VARARGS|METH_KEYWORDS, 0};
3028 static PyObject *__pyx_pw_13cpartitioning_1partitionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3029  struct PyMPICommObject *__pyx_v_comm = 0;
3030  int __pyx_v_nLayersOfOverlap;
3031  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
3032  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
3033  int __pyx_lineno = 0;
3034  const char *__pyx_filename = NULL;
3035  int __pyx_clineno = 0;
3036  PyObject *__pyx_r = 0;
3037  __Pyx_RefNannyDeclarations
3038  __Pyx_RefNannySetupContext("partitionElements (wrapper)", 0);
3039  {
3040  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
3041  PyObject* values[4] = {0,0,0,0};
3042  if (unlikely(__pyx_kwds)) {
3043  Py_ssize_t kw_args;
3044  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3045  switch (pos_args) {
3046  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3047  CYTHON_FALLTHROUGH;
3048  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3049  CYTHON_FALLTHROUGH;
3050  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3051  CYTHON_FALLTHROUGH;
3052  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3053  CYTHON_FALLTHROUGH;
3054  case 0: break;
3055  default: goto __pyx_L5_argtuple_error;
3056  }
3057  kw_args = PyDict_Size(__pyx_kwds);
3058  switch (pos_args) {
3059  case 0:
3060  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
3061  else goto __pyx_L5_argtuple_error;
3062  CYTHON_FALLTHROUGH;
3063  case 1:
3064  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
3065  else {
3066  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, 1); __PYX_ERR(0, 20, __pyx_L3_error)
3067  }
3068  CYTHON_FALLTHROUGH;
3069  case 2:
3070  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3071  else {
3072  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, 2); __PYX_ERR(0, 20, __pyx_L3_error)
3073  }
3074  CYTHON_FALLTHROUGH;
3075  case 3:
3076  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
3077  else {
3078  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, 3); __PYX_ERR(0, 20, __pyx_L3_error)
3079  }
3080  }
3081  if (unlikely(kw_args > 0)) {
3082  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partitionElements") < 0)) __PYX_ERR(0, 20, __pyx_L3_error)
3083  }
3084  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3085  goto __pyx_L5_argtuple_error;
3086  } else {
3087  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3088  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3089  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3090  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3091  }
3092  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
3093  __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L3_error)
3094  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
3095  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
3096  }
3097  goto __pyx_L4_argument_unpacking_done;
3098  __pyx_L5_argtuple_error:;
3099  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 20, __pyx_L3_error)
3100  __pyx_L3_error:;
3101  __Pyx_AddTraceback("cpartitioning.partitionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3102  __Pyx_RefNannyFinishContext();
3103  return NULL;
3104  __pyx_L4_argument_unpacking_done:;
3105  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
3106  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
3107  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
3108  __pyx_r = __pyx_pf_13cpartitioning_partitionElements(__pyx_self, __pyx_v_comm, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
3109 
3110  /* function exit code */
3111  goto __pyx_L0;
3112  __pyx_L1_error:;
3113  __pyx_r = NULL;
3114  __pyx_L0:;
3115  __Pyx_RefNannyFinishContext();
3116  return __pyx_r;
3117 }
3118 
3119 static PyObject *__pyx_pf_13cpartitioning_partitionElements(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
3120  PyObject *__pyx_r = NULL;
3121  __Pyx_RefNannyDeclarations
3122  PyObject *__pyx_t_1 = NULL;
3123  PyObject *__pyx_t_2 = NULL;
3124  PyObject *__pyx_t_3 = NULL;
3125  int *__pyx_t_4;
3126  PyObject *__pyx_t_5 = NULL;
3127  Py_ssize_t __pyx_t_6;
3128  struct __pyx_array_obj *__pyx_t_7 = NULL;
3129  PyObject *__pyx_t_8 = NULL;
3130  PyObject *__pyx_t_9 = NULL;
3131  PyObject *__pyx_t_10 = NULL;
3132  PyObject *__pyx_t_11 = NULL;
3133  PyObject *__pyx_t_12 = NULL;
3134  PyObject *__pyx_t_13 = NULL;
3135  PyObject *__pyx_t_14 = NULL;
3136  int __pyx_lineno = 0;
3137  const char *__pyx_filename = NULL;
3138  int __pyx_clineno = 0;
3139  __Pyx_RefNannySetupContext("partitionElements", 0);
3140 
3141  /* "cpartitioning.pyx":21
3142  *
3143  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3144  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
3145  * c_partitionElements(comm.ob_mpi,
3146  * cmesh.mesh,
3147  */
3148  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
3149 
3150  /* "cpartitioning.pyx":22
3151  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3152  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3153  * c_partitionElements(comm.ob_mpi, # <<<<<<<<<<<<<<
3154  * cmesh.mesh,
3155  * nLayersOfOverlap)
3156  */
3157  (void)(proteus::partitionElements(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
3158 
3159  /* "cpartitioning.pyx":25
3160  * cmesh.mesh,
3161  * nLayersOfOverlap)
3162  * return ( # <<<<<<<<<<<<<<
3163  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
3164  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3165  */
3166  __Pyx_XDECREF(__pyx_r);
3167 
3168  /* "cpartitioning.pyx":26
3169  * nLayersOfOverlap)
3170  * return (
3171  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3172  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3173  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3174  */
3175  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
3176  __Pyx_GOTREF(__pyx_t_2);
3177  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
3178  __Pyx_GOTREF(__pyx_t_3);
3179  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3180  __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
3181  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
3182  __Pyx_GOTREF(__pyx_t_2);
3183  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
3184  __Pyx_GOTREF(__pyx_t_5);
3185  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3186  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L1_error)
3187  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3188  if (!__pyx_t_4) {
3189  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3190  __PYX_ERR(0, 26, __pyx_L1_error)
3191  }
3192  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
3193  __Pyx_GOTREF(__pyx_t_2);
3194  __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
3195  __Pyx_GOTREF(__pyx_t_5);
3196  __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(int), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_4);
3197  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 26, __pyx_L1_error)
3198  __Pyx_GOTREF(__pyx_t_7);
3199  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3200  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3201  __pyx_t_2 = NULL;
3202  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3203  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3204  if (likely(__pyx_t_2)) {
3205  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3206  __Pyx_INCREF(__pyx_t_2);
3207  __Pyx_INCREF(function);
3208  __Pyx_DECREF_SET(__pyx_t_3, function);
3209  }
3210  }
3211  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
3212  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3213  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3214  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
3215  __Pyx_GOTREF(__pyx_t_1);
3216  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3217 
3218  /* "cpartitioning.pyx":27
3219  * return (
3220  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
3221  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
3222  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3223  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3224  */
3225  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
3226  __Pyx_GOTREF(__pyx_t_2);
3227  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error)
3228  __Pyx_GOTREF(__pyx_t_5);
3229  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3230  __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
3231  if (!__pyx_t_4) {
3232  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3233  __PYX_ERR(0, 27, __pyx_L1_error)
3234  }
3235  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 27, __pyx_L1_error)
3236  __Pyx_GOTREF(__pyx_t_8);
3237  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
3238  __Pyx_GOTREF(__pyx_t_2);
3239  __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3240  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 27, __pyx_L1_error)
3241  __Pyx_GOTREF(__pyx_t_7);
3242  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3243  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3244  __pyx_t_8 = NULL;
3245  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3246  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
3247  if (likely(__pyx_t_8)) {
3248  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3249  __Pyx_INCREF(__pyx_t_8);
3250  __Pyx_INCREF(function);
3251  __Pyx_DECREF_SET(__pyx_t_5, function);
3252  }
3253  }
3254  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
3255  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3256  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3257  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error)
3258  __Pyx_GOTREF(__pyx_t_3);
3259  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3260 
3261  /* "cpartitioning.pyx":28
3262  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
3263  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3264  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3265  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3266  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3267  */
3268  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 28, __pyx_L1_error)
3269  __Pyx_GOTREF(__pyx_t_8);
3270  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
3271  __Pyx_GOTREF(__pyx_t_2);
3272  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3273  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
3274  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 28, __pyx_L1_error)
3275  __Pyx_GOTREF(__pyx_t_8);
3276  __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 28, __pyx_L1_error)
3277  __Pyx_GOTREF(__pyx_t_9);
3278  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3279  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L1_error)
3280  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3281  if (!__pyx_t_4) {
3282  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3283  __PYX_ERR(0, 28, __pyx_L1_error)
3284  }
3285  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 28, __pyx_L1_error)
3286  __Pyx_GOTREF(__pyx_t_8);
3287  __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 28, __pyx_L1_error)
3288  __Pyx_GOTREF(__pyx_t_9);
3289  __pyx_t_7 = __pyx_array_new(__pyx_t_9, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3290  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 28, __pyx_L1_error)
3291  __Pyx_GOTREF(__pyx_t_7);
3292  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3293  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3294  __pyx_t_8 = NULL;
3295  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3296  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
3297  if (likely(__pyx_t_8)) {
3298  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3299  __Pyx_INCREF(__pyx_t_8);
3300  __Pyx_INCREF(function);
3301  __Pyx_DECREF_SET(__pyx_t_2, function);
3302  }
3303  }
3304  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
3305  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3306  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3307  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 28, __pyx_L1_error)
3308  __Pyx_GOTREF(__pyx_t_5);
3309  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3310 
3311  /* "cpartitioning.pyx":29
3312  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3313  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3314  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
3315  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3316  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3317  */
3318  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 29, __pyx_L1_error)
3319  __Pyx_GOTREF(__pyx_t_8);
3320  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 29, __pyx_L1_error)
3321  __Pyx_GOTREF(__pyx_t_9);
3322  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3323  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
3324  if (!__pyx_t_4) {
3325  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3326  __PYX_ERR(0, 29, __pyx_L1_error)
3327  }
3328  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 29, __pyx_L1_error)
3329  __Pyx_GOTREF(__pyx_t_10);
3330  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 29, __pyx_L1_error)
3331  __Pyx_GOTREF(__pyx_t_8);
3332  __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
3333  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 29, __pyx_L1_error)
3334  __Pyx_GOTREF(__pyx_t_7);
3335  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3336  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3337  __pyx_t_10 = NULL;
3338  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
3339  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
3340  if (likely(__pyx_t_10)) {
3341  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
3342  __Pyx_INCREF(__pyx_t_10);
3343  __Pyx_INCREF(function);
3344  __Pyx_DECREF_SET(__pyx_t_9, function);
3345  }
3346  }
3347  __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
3348  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3349  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3350  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
3351  __Pyx_GOTREF(__pyx_t_2);
3352  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3353 
3354  /* "cpartitioning.pyx":30
3355  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3356  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3357  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3358  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3359  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
3360  */
3361  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 30, __pyx_L1_error)
3362  __Pyx_GOTREF(__pyx_t_10);
3363  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 30, __pyx_L1_error)
3364  __Pyx_GOTREF(__pyx_t_8);
3365  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3366  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
3367  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 30, __pyx_L1_error)
3368  __Pyx_GOTREF(__pyx_t_10);
3369  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 30, __pyx_L1_error)
3370  __Pyx_GOTREF(__pyx_t_11);
3371  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3372  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L1_error)
3373  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3374  if (!__pyx_t_4) {
3375  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3376  __PYX_ERR(0, 30, __pyx_L1_error)
3377  }
3378  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 30, __pyx_L1_error)
3379  __Pyx_GOTREF(__pyx_t_10);
3380  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 30, __pyx_L1_error)
3381  __Pyx_GOTREF(__pyx_t_11);
3382  __pyx_t_7 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
3383  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 30, __pyx_L1_error)
3384  __Pyx_GOTREF(__pyx_t_7);
3385  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3386  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3387  __pyx_t_10 = NULL;
3388  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
3389  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
3390  if (likely(__pyx_t_10)) {
3391  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
3392  __Pyx_INCREF(__pyx_t_10);
3393  __Pyx_INCREF(function);
3394  __Pyx_DECREF_SET(__pyx_t_8, function);
3395  }
3396  }
3397  __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
3398  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3399  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3400  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 30, __pyx_L1_error)
3401  __Pyx_GOTREF(__pyx_t_9);
3402  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3403 
3404  /* "cpartitioning.pyx":31
3405  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3406  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3407  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
3408  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
3409  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
3410  */
3411  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 31, __pyx_L1_error)
3412  __Pyx_GOTREF(__pyx_t_10);
3413  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 31, __pyx_L1_error)
3414  __Pyx_GOTREF(__pyx_t_11);
3415  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3416  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
3417  if (!__pyx_t_4) {
3418  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3419  __PYX_ERR(0, 31, __pyx_L1_error)
3420  }
3421  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 31, __pyx_L1_error)
3422  __Pyx_GOTREF(__pyx_t_12);
3423  __pyx_t_10 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 31, __pyx_L1_error)
3424  __Pyx_GOTREF(__pyx_t_10);
3425  __pyx_t_7 = __pyx_array_new(__pyx_t_10, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
3426  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 31, __pyx_L1_error)
3427  __Pyx_GOTREF(__pyx_t_7);
3428  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3429  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3430  __pyx_t_12 = NULL;
3431  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
3432  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
3433  if (likely(__pyx_t_12)) {
3434  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
3435  __Pyx_INCREF(__pyx_t_12);
3436  __Pyx_INCREF(function);
3437  __Pyx_DECREF_SET(__pyx_t_11, function);
3438  }
3439  }
3440  __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
3441  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3442  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3443  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 31, __pyx_L1_error)
3444  __Pyx_GOTREF(__pyx_t_8);
3445  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3446 
3447  /* "cpartitioning.pyx":32
3448  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3449  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3450  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3451  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
3452  * )
3453  */
3454  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 32, __pyx_L1_error)
3455  __Pyx_GOTREF(__pyx_t_12);
3456  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 32, __pyx_L1_error)
3457  __Pyx_GOTREF(__pyx_t_10);
3458  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3459  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
3460  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 32, __pyx_L1_error)
3461  __Pyx_GOTREF(__pyx_t_12);
3462  __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 32, __pyx_L1_error)
3463  __Pyx_GOTREF(__pyx_t_13);
3464  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3465  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L1_error)
3466  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3467  if (!__pyx_t_4) {
3468  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3469  __PYX_ERR(0, 32, __pyx_L1_error)
3470  }
3471  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 32, __pyx_L1_error)
3472  __Pyx_GOTREF(__pyx_t_12);
3473  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 32, __pyx_L1_error)
3474  __Pyx_GOTREF(__pyx_t_13);
3475  __pyx_t_7 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
3476  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 32, __pyx_L1_error)
3477  __Pyx_GOTREF(__pyx_t_7);
3478  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3479  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3480  __pyx_t_12 = NULL;
3481  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
3482  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
3483  if (likely(__pyx_t_12)) {
3484  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
3485  __Pyx_INCREF(__pyx_t_12);
3486  __Pyx_INCREF(function);
3487  __Pyx_DECREF_SET(__pyx_t_10, function);
3488  }
3489  }
3490  __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
3491  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3492  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3493  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 32, __pyx_L1_error)
3494  __Pyx_GOTREF(__pyx_t_11);
3495  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3496 
3497  /* "cpartitioning.pyx":33
3498  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3499  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
3500  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
3501  * )
3502  *
3503  */
3504  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 33, __pyx_L1_error)
3505  __Pyx_GOTREF(__pyx_t_12);
3506  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 33, __pyx_L1_error)
3507  __Pyx_GOTREF(__pyx_t_13);
3508  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3509  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
3510  if (!__pyx_t_4) {
3511  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3512  __PYX_ERR(0, 33, __pyx_L1_error)
3513  }
3514  __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 33, __pyx_L1_error)
3515  __Pyx_GOTREF(__pyx_t_14);
3516  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 33, __pyx_L1_error)
3517  __Pyx_GOTREF(__pyx_t_12);
3518  __pyx_t_7 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_14), (char *) "c", (char *) __pyx_t_4);
3519  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 33, __pyx_L1_error)
3520  __Pyx_GOTREF(__pyx_t_7);
3521  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3522  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3523  __pyx_t_14 = NULL;
3524  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
3525  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
3526  if (likely(__pyx_t_14)) {
3527  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
3528  __Pyx_INCREF(__pyx_t_14);
3529  __Pyx_INCREF(function);
3530  __Pyx_DECREF_SET(__pyx_t_13, function);
3531  }
3532  }
3533  __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
3534  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3535  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3536  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 33, __pyx_L1_error)
3537  __Pyx_GOTREF(__pyx_t_10);
3538  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3539 
3540  /* "cpartitioning.pyx":26
3541  * nLayersOfOverlap)
3542  * return (
3543  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3544  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3545  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3546  */
3547  __pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 26, __pyx_L1_error)
3548  __Pyx_GOTREF(__pyx_t_13);
3549  __Pyx_GIVEREF(__pyx_t_1);
3550  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
3551  __Pyx_GIVEREF(__pyx_t_3);
3552  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
3553  __Pyx_GIVEREF(__pyx_t_5);
3554  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
3555  __Pyx_GIVEREF(__pyx_t_2);
3556  PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
3557  __Pyx_GIVEREF(__pyx_t_9);
3558  PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
3559  __Pyx_GIVEREF(__pyx_t_8);
3560  PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
3561  __Pyx_GIVEREF(__pyx_t_11);
3562  PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
3563  __Pyx_GIVEREF(__pyx_t_10);
3564  PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
3565  __pyx_t_1 = 0;
3566  __pyx_t_3 = 0;
3567  __pyx_t_5 = 0;
3568  __pyx_t_2 = 0;
3569  __pyx_t_9 = 0;
3570  __pyx_t_8 = 0;
3571  __pyx_t_11 = 0;
3572  __pyx_t_10 = 0;
3573  __pyx_r = __pyx_t_13;
3574  __pyx_t_13 = 0;
3575  goto __pyx_L0;
3576 
3577  /* "cpartitioning.pyx":20
3578  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
3579  *
3580  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3581  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3582  * c_partitionElements(comm.ob_mpi,
3583  */
3584 
3585  /* function exit code */
3586  __pyx_L1_error:;
3587  __Pyx_XDECREF(__pyx_t_1);
3588  __Pyx_XDECREF(__pyx_t_2);
3589  __Pyx_XDECREF(__pyx_t_3);
3590  __Pyx_XDECREF(__pyx_t_5);
3591  __Pyx_XDECREF(((PyObject *)__pyx_t_7));
3592  __Pyx_XDECREF(__pyx_t_8);
3593  __Pyx_XDECREF(__pyx_t_9);
3594  __Pyx_XDECREF(__pyx_t_10);
3595  __Pyx_XDECREF(__pyx_t_11);
3596  __Pyx_XDECREF(__pyx_t_12);
3597  __Pyx_XDECREF(__pyx_t_13);
3598  __Pyx_XDECREF(__pyx_t_14);
3599  __Pyx_AddTraceback("cpartitioning.partitionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3600  __pyx_r = NULL;
3601  __pyx_L0:;
3602  __Pyx_XGIVEREF(__pyx_r);
3603  __Pyx_RefNannyFinishContext();
3604  return __pyx_r;
3605 }
3606 
3607 /* "cpartitioning.pyx":36
3608  * )
3609  *
3610  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3611  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3612  * c_partitionNodes(comm.ob_mpi,
3613  */
3614 
3615 /* Python wrapper */
3616 static PyObject *__pyx_pw_13cpartitioning_3partitionNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3617 static PyMethodDef __pyx_mdef_13cpartitioning_3partitionNodes = {"partitionNodes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_3partitionNodes, METH_VARARGS|METH_KEYWORDS, 0};
3618 static PyObject *__pyx_pw_13cpartitioning_3partitionNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3619  struct PyMPICommObject *__pyx_v_comm = 0;
3620  int __pyx_v_nLayersOfOverlap;
3621  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
3622  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
3623  int __pyx_lineno = 0;
3624  const char *__pyx_filename = NULL;
3625  int __pyx_clineno = 0;
3626  PyObject *__pyx_r = 0;
3627  __Pyx_RefNannyDeclarations
3628  __Pyx_RefNannySetupContext("partitionNodes (wrapper)", 0);
3629  {
3630  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
3631  PyObject* values[4] = {0,0,0,0};
3632  if (unlikely(__pyx_kwds)) {
3633  Py_ssize_t kw_args;
3634  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3635  switch (pos_args) {
3636  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3637  CYTHON_FALLTHROUGH;
3638  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3639  CYTHON_FALLTHROUGH;
3640  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3641  CYTHON_FALLTHROUGH;
3642  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3643  CYTHON_FALLTHROUGH;
3644  case 0: break;
3645  default: goto __pyx_L5_argtuple_error;
3646  }
3647  kw_args = PyDict_Size(__pyx_kwds);
3648  switch (pos_args) {
3649  case 0:
3650  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
3651  else goto __pyx_L5_argtuple_error;
3652  CYTHON_FALLTHROUGH;
3653  case 1:
3654  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
3655  else {
3656  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, 1); __PYX_ERR(0, 36, __pyx_L3_error)
3657  }
3658  CYTHON_FALLTHROUGH;
3659  case 2:
3660  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3661  else {
3662  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, 2); __PYX_ERR(0, 36, __pyx_L3_error)
3663  }
3664  CYTHON_FALLTHROUGH;
3665  case 3:
3666  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
3667  else {
3668  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, 3); __PYX_ERR(0, 36, __pyx_L3_error)
3669  }
3670  }
3671  if (unlikely(kw_args > 0)) {
3672  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partitionNodes") < 0)) __PYX_ERR(0, 36, __pyx_L3_error)
3673  }
3674  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3675  goto __pyx_L5_argtuple_error;
3676  } else {
3677  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3678  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3679  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3680  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3681  }
3682  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
3683  __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error)
3684  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
3685  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
3686  }
3687  goto __pyx_L4_argument_unpacking_done;
3688  __pyx_L5_argtuple_error:;
3689  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 36, __pyx_L3_error)
3690  __pyx_L3_error:;
3691  __Pyx_AddTraceback("cpartitioning.partitionNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
3692  __Pyx_RefNannyFinishContext();
3693  return NULL;
3694  __pyx_L4_argument_unpacking_done:;
3695  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
3696  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
3697  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
3698  __pyx_r = __pyx_pf_13cpartitioning_2partitionNodes(__pyx_self, __pyx_v_comm, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
3699 
3700  /* function exit code */
3701  goto __pyx_L0;
3702  __pyx_L1_error:;
3703  __pyx_r = NULL;
3704  __pyx_L0:;
3705  __Pyx_RefNannyFinishContext();
3706  return __pyx_r;
3707 }
3708 
3709 static PyObject *__pyx_pf_13cpartitioning_2partitionNodes(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
3710  PyObject *__pyx_r = NULL;
3711  __Pyx_RefNannyDeclarations
3712  PyObject *__pyx_t_1 = NULL;
3713  PyObject *__pyx_t_2 = NULL;
3714  PyObject *__pyx_t_3 = NULL;
3715  int *__pyx_t_4;
3716  PyObject *__pyx_t_5 = NULL;
3717  Py_ssize_t __pyx_t_6;
3718  struct __pyx_array_obj *__pyx_t_7 = NULL;
3719  PyObject *__pyx_t_8 = NULL;
3720  PyObject *__pyx_t_9 = NULL;
3721  PyObject *__pyx_t_10 = NULL;
3722  PyObject *__pyx_t_11 = NULL;
3723  PyObject *__pyx_t_12 = NULL;
3724  PyObject *__pyx_t_13 = NULL;
3725  PyObject *__pyx_t_14 = NULL;
3726  int __pyx_lineno = 0;
3727  const char *__pyx_filename = NULL;
3728  int __pyx_clineno = 0;
3729  __Pyx_RefNannySetupContext("partitionNodes", 0);
3730 
3731  /* "cpartitioning.pyx":37
3732  *
3733  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3734  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
3735  * c_partitionNodes(comm.ob_mpi,
3736  * cmesh.mesh,
3737  */
3738  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
3739 
3740  /* "cpartitioning.pyx":38
3741  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3742  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3743  * c_partitionNodes(comm.ob_mpi, # <<<<<<<<<<<<<<
3744  * cmesh.mesh,
3745  * nLayersOfOverlap)
3746  */
3747  (void)(proteus::partitionNodes(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
3748 
3749  /* "cpartitioning.pyx":41
3750  * cmesh.mesh,
3751  * nLayersOfOverlap)
3752  * return ( # <<<<<<<<<<<<<<
3753  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
3754  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3755  */
3756  __Pyx_XDECREF(__pyx_r);
3757 
3758  /* "cpartitioning.pyx":42
3759  * nLayersOfOverlap)
3760  * return (
3761  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3762  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3763  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3764  */
3765  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
3766  __Pyx_GOTREF(__pyx_t_2);
3767  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
3768  __Pyx_GOTREF(__pyx_t_3);
3769  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3770  __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
3771  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
3772  __Pyx_GOTREF(__pyx_t_2);
3773  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
3774  __Pyx_GOTREF(__pyx_t_5);
3775  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3776  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 42, __pyx_L1_error)
3777  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3778  if (!__pyx_t_4) {
3779  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3780  __PYX_ERR(0, 42, __pyx_L1_error)
3781  }
3782  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
3783  __Pyx_GOTREF(__pyx_t_2);
3784  __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
3785  __Pyx_GOTREF(__pyx_t_5);
3786  __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(int), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_4);
3787  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error)
3788  __Pyx_GOTREF(__pyx_t_7);
3789  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3790  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3791  __pyx_t_2 = NULL;
3792  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3793  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3794  if (likely(__pyx_t_2)) {
3795  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3796  __Pyx_INCREF(__pyx_t_2);
3797  __Pyx_INCREF(function);
3798  __Pyx_DECREF_SET(__pyx_t_3, function);
3799  }
3800  }
3801  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
3802  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3803  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3804  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
3805  __Pyx_GOTREF(__pyx_t_1);
3806  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3807 
3808  /* "cpartitioning.pyx":43
3809  * return (
3810  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
3811  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
3812  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3813  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3814  */
3815  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
3816  __Pyx_GOTREF(__pyx_t_2);
3817  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 43, __pyx_L1_error)
3818  __Pyx_GOTREF(__pyx_t_5);
3819  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3820  __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
3821  if (!__pyx_t_4) {
3822  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3823  __PYX_ERR(0, 43, __pyx_L1_error)
3824  }
3825  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L1_error)
3826  __Pyx_GOTREF(__pyx_t_8);
3827  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
3828  __Pyx_GOTREF(__pyx_t_2);
3829  __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3830  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error)
3831  __Pyx_GOTREF(__pyx_t_7);
3832  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3833  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3834  __pyx_t_8 = NULL;
3835  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3836  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
3837  if (likely(__pyx_t_8)) {
3838  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3839  __Pyx_INCREF(__pyx_t_8);
3840  __Pyx_INCREF(function);
3841  __Pyx_DECREF_SET(__pyx_t_5, function);
3842  }
3843  }
3844  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
3845  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3846  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3847  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
3848  __Pyx_GOTREF(__pyx_t_3);
3849  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3850 
3851  /* "cpartitioning.pyx":44
3852  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
3853  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3854  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3855  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3856  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3857  */
3858  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error)
3859  __Pyx_GOTREF(__pyx_t_8);
3860  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
3861  __Pyx_GOTREF(__pyx_t_2);
3862  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3863  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
3864  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error)
3865  __Pyx_GOTREF(__pyx_t_8);
3866  __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error)
3867  __Pyx_GOTREF(__pyx_t_9);
3868  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3869  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error)
3870  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3871  if (!__pyx_t_4) {
3872  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3873  __PYX_ERR(0, 44, __pyx_L1_error)
3874  }
3875  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error)
3876  __Pyx_GOTREF(__pyx_t_8);
3877  __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error)
3878  __Pyx_GOTREF(__pyx_t_9);
3879  __pyx_t_7 = __pyx_array_new(__pyx_t_9, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3880  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 44, __pyx_L1_error)
3881  __Pyx_GOTREF(__pyx_t_7);
3882  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3883  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3884  __pyx_t_8 = NULL;
3885  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3886  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
3887  if (likely(__pyx_t_8)) {
3888  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3889  __Pyx_INCREF(__pyx_t_8);
3890  __Pyx_INCREF(function);
3891  __Pyx_DECREF_SET(__pyx_t_2, function);
3892  }
3893  }
3894  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
3895  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3896  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3897  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 44, __pyx_L1_error)
3898  __Pyx_GOTREF(__pyx_t_5);
3899  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3900 
3901  /* "cpartitioning.pyx":45
3902  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3903  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3904  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
3905  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3906  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3907  */
3908  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error)
3909  __Pyx_GOTREF(__pyx_t_8);
3910  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 45, __pyx_L1_error)
3911  __Pyx_GOTREF(__pyx_t_9);
3912  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3913  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
3914  if (!__pyx_t_4) {
3915  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3916  __PYX_ERR(0, 45, __pyx_L1_error)
3917  }
3918  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 45, __pyx_L1_error)
3919  __Pyx_GOTREF(__pyx_t_10);
3920  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error)
3921  __Pyx_GOTREF(__pyx_t_8);
3922  __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
3923  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error)
3924  __Pyx_GOTREF(__pyx_t_7);
3925  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3926  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3927  __pyx_t_10 = NULL;
3928  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
3929  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
3930  if (likely(__pyx_t_10)) {
3931  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
3932  __Pyx_INCREF(__pyx_t_10);
3933  __Pyx_INCREF(function);
3934  __Pyx_DECREF_SET(__pyx_t_9, function);
3935  }
3936  }
3937  __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
3938  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3939  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3940  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
3941  __Pyx_GOTREF(__pyx_t_2);
3942  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3943 
3944  /* "cpartitioning.pyx":46
3945  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3946  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3947  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3948  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3949  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
3950  */
3951  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
3952  __Pyx_GOTREF(__pyx_t_10);
3953  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 46, __pyx_L1_error)
3954  __Pyx_GOTREF(__pyx_t_8);
3955  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3956  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
3957  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
3958  __Pyx_GOTREF(__pyx_t_10);
3959  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 46, __pyx_L1_error)
3960  __Pyx_GOTREF(__pyx_t_11);
3961  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3962  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error)
3963  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3964  if (!__pyx_t_4) {
3965  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3966  __PYX_ERR(0, 46, __pyx_L1_error)
3967  }
3968  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
3969  __Pyx_GOTREF(__pyx_t_10);
3970  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 46, __pyx_L1_error)
3971  __Pyx_GOTREF(__pyx_t_11);
3972  __pyx_t_7 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
3973  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 46, __pyx_L1_error)
3974  __Pyx_GOTREF(__pyx_t_7);
3975  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3976  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3977  __pyx_t_10 = NULL;
3978  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
3979  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
3980  if (likely(__pyx_t_10)) {
3981  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
3982  __Pyx_INCREF(__pyx_t_10);
3983  __Pyx_INCREF(function);
3984  __Pyx_DECREF_SET(__pyx_t_8, function);
3985  }
3986  }
3987  __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
3988  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3989  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3990  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 46, __pyx_L1_error)
3991  __Pyx_GOTREF(__pyx_t_9);
3992  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3993 
3994  /* "cpartitioning.pyx":47
3995  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3996  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3997  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
3998  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
3999  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4000  */
4001  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 47, __pyx_L1_error)
4002  __Pyx_GOTREF(__pyx_t_10);
4003  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 47, __pyx_L1_error)
4004  __Pyx_GOTREF(__pyx_t_11);
4005  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4006  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
4007  if (!__pyx_t_4) {
4008  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4009  __PYX_ERR(0, 47, __pyx_L1_error)
4010  }
4011  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 47, __pyx_L1_error)
4012  __Pyx_GOTREF(__pyx_t_12);
4013  __pyx_t_10 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 47, __pyx_L1_error)
4014  __Pyx_GOTREF(__pyx_t_10);
4015  __pyx_t_7 = __pyx_array_new(__pyx_t_10, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4016  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L1_error)
4017  __Pyx_GOTREF(__pyx_t_7);
4018  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4019  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4020  __pyx_t_12 = NULL;
4021  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
4022  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
4023  if (likely(__pyx_t_12)) {
4024  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
4025  __Pyx_INCREF(__pyx_t_12);
4026  __Pyx_INCREF(function);
4027  __Pyx_DECREF_SET(__pyx_t_11, function);
4028  }
4029  }
4030  __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
4031  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4032  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4033  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 47, __pyx_L1_error)
4034  __Pyx_GOTREF(__pyx_t_8);
4035  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4036 
4037  /* "cpartitioning.pyx":48
4038  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4039  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4040  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4041  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4042  * )
4043  */
4044  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error)
4045  __Pyx_GOTREF(__pyx_t_12);
4046  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 48, __pyx_L1_error)
4047  __Pyx_GOTREF(__pyx_t_10);
4048  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4049  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
4050  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error)
4051  __Pyx_GOTREF(__pyx_t_12);
4052  __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 48, __pyx_L1_error)
4053  __Pyx_GOTREF(__pyx_t_13);
4054  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4055  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L1_error)
4056  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4057  if (!__pyx_t_4) {
4058  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4059  __PYX_ERR(0, 48, __pyx_L1_error)
4060  }
4061  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error)
4062  __Pyx_GOTREF(__pyx_t_12);
4063  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 48, __pyx_L1_error)
4064  __Pyx_GOTREF(__pyx_t_13);
4065  __pyx_t_7 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4066  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 48, __pyx_L1_error)
4067  __Pyx_GOTREF(__pyx_t_7);
4068  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4069  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4070  __pyx_t_12 = NULL;
4071  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
4072  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
4073  if (likely(__pyx_t_12)) {
4074  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
4075  __Pyx_INCREF(__pyx_t_12);
4076  __Pyx_INCREF(function);
4077  __Pyx_DECREF_SET(__pyx_t_10, function);
4078  }
4079  }
4080  __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
4081  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4082  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4083  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 48, __pyx_L1_error)
4084  __Pyx_GOTREF(__pyx_t_11);
4085  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4086 
4087  /* "cpartitioning.pyx":49
4088  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4089  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4090  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
4091  * )
4092  *
4093  */
4094  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 49, __pyx_L1_error)
4095  __Pyx_GOTREF(__pyx_t_12);
4096  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 49, __pyx_L1_error)
4097  __Pyx_GOTREF(__pyx_t_13);
4098  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4099  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
4100  if (!__pyx_t_4) {
4101  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4102  __PYX_ERR(0, 49, __pyx_L1_error)
4103  }
4104  __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 49, __pyx_L1_error)
4105  __Pyx_GOTREF(__pyx_t_14);
4106  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 49, __pyx_L1_error)
4107  __Pyx_GOTREF(__pyx_t_12);
4108  __pyx_t_7 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_14), (char *) "c", (char *) __pyx_t_4);
4109  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 49, __pyx_L1_error)
4110  __Pyx_GOTREF(__pyx_t_7);
4111  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4112  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4113  __pyx_t_14 = NULL;
4114  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
4115  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
4116  if (likely(__pyx_t_14)) {
4117  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
4118  __Pyx_INCREF(__pyx_t_14);
4119  __Pyx_INCREF(function);
4120  __Pyx_DECREF_SET(__pyx_t_13, function);
4121  }
4122  }
4123  __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
4124  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4125  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4126  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 49, __pyx_L1_error)
4127  __Pyx_GOTREF(__pyx_t_10);
4128  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4129 
4130  /* "cpartitioning.pyx":42
4131  * nLayersOfOverlap)
4132  * return (
4133  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4134  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4135  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4136  */
4137  __pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 42, __pyx_L1_error)
4138  __Pyx_GOTREF(__pyx_t_13);
4139  __Pyx_GIVEREF(__pyx_t_1);
4140  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
4141  __Pyx_GIVEREF(__pyx_t_3);
4142  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
4143  __Pyx_GIVEREF(__pyx_t_5);
4144  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
4145  __Pyx_GIVEREF(__pyx_t_2);
4146  PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
4147  __Pyx_GIVEREF(__pyx_t_9);
4148  PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
4149  __Pyx_GIVEREF(__pyx_t_8);
4150  PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
4151  __Pyx_GIVEREF(__pyx_t_11);
4152  PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
4153  __Pyx_GIVEREF(__pyx_t_10);
4154  PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
4155  __pyx_t_1 = 0;
4156  __pyx_t_3 = 0;
4157  __pyx_t_5 = 0;
4158  __pyx_t_2 = 0;
4159  __pyx_t_9 = 0;
4160  __pyx_t_8 = 0;
4161  __pyx_t_11 = 0;
4162  __pyx_t_10 = 0;
4163  __pyx_r = __pyx_t_13;
4164  __pyx_t_13 = 0;
4165  goto __pyx_L0;
4166 
4167  /* "cpartitioning.pyx":36
4168  * )
4169  *
4170  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4171  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4172  * c_partitionNodes(comm.ob_mpi,
4173  */
4174 
4175  /* function exit code */
4176  __pyx_L1_error:;
4177  __Pyx_XDECREF(__pyx_t_1);
4178  __Pyx_XDECREF(__pyx_t_2);
4179  __Pyx_XDECREF(__pyx_t_3);
4180  __Pyx_XDECREF(__pyx_t_5);
4181  __Pyx_XDECREF(((PyObject *)__pyx_t_7));
4182  __Pyx_XDECREF(__pyx_t_8);
4183  __Pyx_XDECREF(__pyx_t_9);
4184  __Pyx_XDECREF(__pyx_t_10);
4185  __Pyx_XDECREF(__pyx_t_11);
4186  __Pyx_XDECREF(__pyx_t_12);
4187  __Pyx_XDECREF(__pyx_t_13);
4188  __Pyx_XDECREF(__pyx_t_14);
4189  __Pyx_AddTraceback("cpartitioning.partitionNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
4190  __pyx_r = NULL;
4191  __pyx_L0:;
4192  __Pyx_XGIVEREF(__pyx_r);
4193  __Pyx_RefNannyFinishContext();
4194  return __pyx_r;
4195 }
4196 
4197 /* "cpartitioning.pyx":52
4198  * )
4199  *
4200  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4201  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4202  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4203  */
4204 
4205 /* Python wrapper */
4206 static PyObject *__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4207 static PyMethodDef __pyx_mdef_13cpartitioning_5convertPUMIPartitionToPython = {"convertPUMIPartitionToPython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython, METH_VARARGS|METH_KEYWORDS, 0};
4208 static PyObject *__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4209  CYTHON_UNUSED struct PyMPICommObject *__pyx_v_comm = 0;
4210  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
4211  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
4212  int __pyx_lineno = 0;
4213  const char *__pyx_filename = NULL;
4214  int __pyx_clineno = 0;
4215  PyObject *__pyx_r = 0;
4216  __Pyx_RefNannyDeclarations
4217  __Pyx_RefNannySetupContext("convertPUMIPartitionToPython (wrapper)", 0);
4218  {
4219  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
4220  PyObject* values[3] = {0,0,0};
4221  if (unlikely(__pyx_kwds)) {
4222  Py_ssize_t kw_args;
4223  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4224  switch (pos_args) {
4225  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4226  CYTHON_FALLTHROUGH;
4227  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4228  CYTHON_FALLTHROUGH;
4229  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4230  CYTHON_FALLTHROUGH;
4231  case 0: break;
4232  default: goto __pyx_L5_argtuple_error;
4233  }
4234  kw_args = PyDict_Size(__pyx_kwds);
4235  switch (pos_args) {
4236  case 0:
4237  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
4238  else goto __pyx_L5_argtuple_error;
4239  CYTHON_FALLTHROUGH;
4240  case 1:
4241  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4242  else {
4243  __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, 1); __PYX_ERR(0, 52, __pyx_L3_error)
4244  }
4245  CYTHON_FALLTHROUGH;
4246  case 2:
4247  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
4248  else {
4249  __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, 2); __PYX_ERR(0, 52, __pyx_L3_error)
4250  }
4251  }
4252  if (unlikely(kw_args > 0)) {
4253  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convertPUMIPartitionToPython") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
4254  }
4255  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4256  goto __pyx_L5_argtuple_error;
4257  } else {
4258  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4259  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4260  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4261  }
4262  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
4263  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[1]);
4264  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
4265  }
4266  goto __pyx_L4_argument_unpacking_done;
4267  __pyx_L5_argtuple_error:;
4268  __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
4269  __pyx_L3_error:;
4270  __Pyx_AddTraceback("cpartitioning.convertPUMIPartitionToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4271  __Pyx_RefNannyFinishContext();
4272  return NULL;
4273  __pyx_L4_argument_unpacking_done:;
4274  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 52, __pyx_L1_error)
4275  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 52, __pyx_L1_error)
4276  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 52, __pyx_L1_error)
4277  __pyx_r = __pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(__pyx_self, __pyx_v_comm, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
4278 
4279  /* function exit code */
4280  goto __pyx_L0;
4281  __pyx_L1_error:;
4282  __pyx_r = NULL;
4283  __pyx_L0:;
4284  __Pyx_RefNannyFinishContext();
4285  return __pyx_r;
4286 }
4287 
4288 static PyObject *__pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct PyMPICommObject *__pyx_v_comm, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
4289  PyObject *__pyx_r = NULL;
4290  __Pyx_RefNannyDeclarations
4291  PyObject *__pyx_t_1 = NULL;
4292  PyObject *__pyx_t_2 = NULL;
4293  PyObject *__pyx_t_3 = NULL;
4294  int *__pyx_t_4;
4295  PyObject *__pyx_t_5 = NULL;
4296  Py_ssize_t __pyx_t_6;
4297  struct __pyx_array_obj *__pyx_t_7 = NULL;
4298  PyObject *__pyx_t_8 = NULL;
4299  PyObject *__pyx_t_9 = NULL;
4300  PyObject *__pyx_t_10 = NULL;
4301  PyObject *__pyx_t_11 = NULL;
4302  PyObject *__pyx_t_12 = NULL;
4303  PyObject *__pyx_t_13 = NULL;
4304  PyObject *__pyx_t_14 = NULL;
4305  int __pyx_lineno = 0;
4306  const char *__pyx_filename = NULL;
4307  int __pyx_clineno = 0;
4308  __Pyx_RefNannySetupContext("convertPUMIPartitionToPython", 0);
4309 
4310  /* "cpartitioning.pyx":54
4311  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4312  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4313  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
4314  * return (
4315  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4316  */
4317  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
4318 
4319  /* "cpartitioning.pyx":55
4320  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4321  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4322  * return ( # <<<<<<<<<<<<<<
4323  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4324  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4325  */
4326  __Pyx_XDECREF(__pyx_r);
4327 
4328  /* "cpartitioning.pyx":56
4329  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4330  * return (
4331  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4332  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4333  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4334  */
4335  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
4336  __Pyx_GOTREF(__pyx_t_2);
4337  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
4338  __Pyx_GOTREF(__pyx_t_3);
4339  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4340  __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
4341  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
4342  __Pyx_GOTREF(__pyx_t_2);
4343  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error)
4344  __Pyx_GOTREF(__pyx_t_5);
4345  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4346  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error)
4347  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4348  if (!__pyx_t_4) {
4349  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4350  __PYX_ERR(0, 56, __pyx_L1_error)
4351  }
4352  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
4353  __Pyx_GOTREF(__pyx_t_2);
4354  __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error)
4355  __Pyx_GOTREF(__pyx_t_5);
4356  __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(int), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_4);
4357  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L1_error)
4358  __Pyx_GOTREF(__pyx_t_7);
4359  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4360  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4361  __pyx_t_2 = NULL;
4362  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4363  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
4364  if (likely(__pyx_t_2)) {
4365  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4366  __Pyx_INCREF(__pyx_t_2);
4367  __Pyx_INCREF(function);
4368  __Pyx_DECREF_SET(__pyx_t_3, function);
4369  }
4370  }
4371  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
4372  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4373  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4374  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
4375  __Pyx_GOTREF(__pyx_t_1);
4376  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4377 
4378  /* "cpartitioning.pyx":57
4379  * return (
4380  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4381  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
4382  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4383  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4384  */
4385  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
4386  __Pyx_GOTREF(__pyx_t_2);
4387  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error)
4388  __Pyx_GOTREF(__pyx_t_5);
4389  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4390  __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
4391  if (!__pyx_t_4) {
4392  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4393  __PYX_ERR(0, 57, __pyx_L1_error)
4394  }
4395  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 57, __pyx_L1_error)
4396  __Pyx_GOTREF(__pyx_t_8);
4397  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
4398  __Pyx_GOTREF(__pyx_t_2);
4399  __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
4400  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L1_error)
4401  __Pyx_GOTREF(__pyx_t_7);
4402  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4403  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4404  __pyx_t_8 = NULL;
4405  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
4406  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
4407  if (likely(__pyx_t_8)) {
4408  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
4409  __Pyx_INCREF(__pyx_t_8);
4410  __Pyx_INCREF(function);
4411  __Pyx_DECREF_SET(__pyx_t_5, function);
4412  }
4413  }
4414  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
4415  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4416  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4417  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error)
4418  __Pyx_GOTREF(__pyx_t_3);
4419  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4420 
4421  /* "cpartitioning.pyx":58
4422  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4423  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4424  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4425  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4426  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4427  */
4428  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error)
4429  __Pyx_GOTREF(__pyx_t_8);
4430  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
4431  __Pyx_GOTREF(__pyx_t_2);
4432  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4433  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
4434  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error)
4435  __Pyx_GOTREF(__pyx_t_8);
4436  __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 58, __pyx_L1_error)
4437  __Pyx_GOTREF(__pyx_t_9);
4438  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4439  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error)
4440  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4441  if (!__pyx_t_4) {
4442  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4443  __PYX_ERR(0, 58, __pyx_L1_error)
4444  }
4445  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error)
4446  __Pyx_GOTREF(__pyx_t_8);
4447  __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 58, __pyx_L1_error)
4448  __Pyx_GOTREF(__pyx_t_9);
4449  __pyx_t_7 = __pyx_array_new(__pyx_t_9, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
4450  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 58, __pyx_L1_error)
4451  __Pyx_GOTREF(__pyx_t_7);
4452  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4453  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4454  __pyx_t_8 = NULL;
4455  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4456  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
4457  if (likely(__pyx_t_8)) {
4458  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4459  __Pyx_INCREF(__pyx_t_8);
4460  __Pyx_INCREF(function);
4461  __Pyx_DECREF_SET(__pyx_t_2, function);
4462  }
4463  }
4464  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
4465  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4466  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4467  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __pyx_L1_error)
4468  __Pyx_GOTREF(__pyx_t_5);
4469  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4470 
4471  /* "cpartitioning.pyx":59
4472  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4473  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4474  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
4475  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4476  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4477  */
4478  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error)
4479  __Pyx_GOTREF(__pyx_t_8);
4480  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 59, __pyx_L1_error)
4481  __Pyx_GOTREF(__pyx_t_9);
4482  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4483  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
4484  if (!__pyx_t_4) {
4485  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4486  __PYX_ERR(0, 59, __pyx_L1_error)
4487  }
4488  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L1_error)
4489  __Pyx_GOTREF(__pyx_t_10);
4490  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error)
4491  __Pyx_GOTREF(__pyx_t_8);
4492  __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
4493  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 59, __pyx_L1_error)
4494  __Pyx_GOTREF(__pyx_t_7);
4495  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4496  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4497  __pyx_t_10 = NULL;
4498  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
4499  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
4500  if (likely(__pyx_t_10)) {
4501  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
4502  __Pyx_INCREF(__pyx_t_10);
4503  __Pyx_INCREF(function);
4504  __Pyx_DECREF_SET(__pyx_t_9, function);
4505  }
4506  }
4507  __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
4508  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4509  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4510  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
4511  __Pyx_GOTREF(__pyx_t_2);
4512  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4513 
4514  /* "cpartitioning.pyx":60
4515  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4516  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4517  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4518  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4519  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4520  */
4521  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error)
4522  __Pyx_GOTREF(__pyx_t_10);
4523  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 60, __pyx_L1_error)
4524  __Pyx_GOTREF(__pyx_t_8);
4525  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4526  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
4527  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error)
4528  __Pyx_GOTREF(__pyx_t_10);
4529  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L1_error)
4530  __Pyx_GOTREF(__pyx_t_11);
4531  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4532  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
4533  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4534  if (!__pyx_t_4) {
4535  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4536  __PYX_ERR(0, 60, __pyx_L1_error)
4537  }
4538  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error)
4539  __Pyx_GOTREF(__pyx_t_10);
4540  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L1_error)
4541  __Pyx_GOTREF(__pyx_t_11);
4542  __pyx_t_7 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
4543  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error)
4544  __Pyx_GOTREF(__pyx_t_7);
4545  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4546  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4547  __pyx_t_10 = NULL;
4548  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
4549  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
4550  if (likely(__pyx_t_10)) {
4551  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
4552  __Pyx_INCREF(__pyx_t_10);
4553  __Pyx_INCREF(function);
4554  __Pyx_DECREF_SET(__pyx_t_8, function);
4555  }
4556  }
4557  __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
4558  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4559  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4560  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L1_error)
4561  __Pyx_GOTREF(__pyx_t_9);
4562  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4563 
4564  /* "cpartitioning.pyx":61
4565  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4566  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4567  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
4568  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4569  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4570  */
4571  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 61, __pyx_L1_error)
4572  __Pyx_GOTREF(__pyx_t_10);
4573  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 61, __pyx_L1_error)
4574  __Pyx_GOTREF(__pyx_t_11);
4575  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4576  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
4577  if (!__pyx_t_4) {
4578  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4579  __PYX_ERR(0, 61, __pyx_L1_error)
4580  }
4581  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 61, __pyx_L1_error)
4582  __Pyx_GOTREF(__pyx_t_12);
4583  __pyx_t_10 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 61, __pyx_L1_error)
4584  __Pyx_GOTREF(__pyx_t_10);
4585  __pyx_t_7 = __pyx_array_new(__pyx_t_10, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4586  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L1_error)
4587  __Pyx_GOTREF(__pyx_t_7);
4588  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4589  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4590  __pyx_t_12 = NULL;
4591  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
4592  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
4593  if (likely(__pyx_t_12)) {
4594  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
4595  __Pyx_INCREF(__pyx_t_12);
4596  __Pyx_INCREF(function);
4597  __Pyx_DECREF_SET(__pyx_t_11, function);
4598  }
4599  }
4600  __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
4601  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4602  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4603  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 61, __pyx_L1_error)
4604  __Pyx_GOTREF(__pyx_t_8);
4605  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4606 
4607  /* "cpartitioning.pyx":62
4608  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4609  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4610  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4611  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4612  * )
4613  */
4614  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 62, __pyx_L1_error)
4615  __Pyx_GOTREF(__pyx_t_12);
4616  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 62, __pyx_L1_error)
4617  __Pyx_GOTREF(__pyx_t_10);
4618  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4619  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
4620  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 62, __pyx_L1_error)
4621  __Pyx_GOTREF(__pyx_t_12);
4622  __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 62, __pyx_L1_error)
4623  __Pyx_GOTREF(__pyx_t_13);
4624  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4625  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L1_error)
4626  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4627  if (!__pyx_t_4) {
4628  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4629  __PYX_ERR(0, 62, __pyx_L1_error)
4630  }
4631  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 62, __pyx_L1_error)
4632  __Pyx_GOTREF(__pyx_t_12);
4633  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 62, __pyx_L1_error)
4634  __Pyx_GOTREF(__pyx_t_13);
4635  __pyx_t_7 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4636  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 62, __pyx_L1_error)
4637  __Pyx_GOTREF(__pyx_t_7);
4638  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4639  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4640  __pyx_t_12 = NULL;
4641  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
4642  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
4643  if (likely(__pyx_t_12)) {
4644  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
4645  __Pyx_INCREF(__pyx_t_12);
4646  __Pyx_INCREF(function);
4647  __Pyx_DECREF_SET(__pyx_t_10, function);
4648  }
4649  }
4650  __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
4651  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4652  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4653  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 62, __pyx_L1_error)
4654  __Pyx_GOTREF(__pyx_t_11);
4655  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4656 
4657  /* "cpartitioning.pyx":63
4658  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4659  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4660  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
4661  * )
4662  *
4663  */
4664  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 63, __pyx_L1_error)
4665  __Pyx_GOTREF(__pyx_t_12);
4666  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 63, __pyx_L1_error)
4667  __Pyx_GOTREF(__pyx_t_13);
4668  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4669  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
4670  if (!__pyx_t_4) {
4671  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4672  __PYX_ERR(0, 63, __pyx_L1_error)
4673  }
4674  __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 63, __pyx_L1_error)
4675  __Pyx_GOTREF(__pyx_t_14);
4676  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 63, __pyx_L1_error)
4677  __Pyx_GOTREF(__pyx_t_12);
4678  __pyx_t_7 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_14), (char *) "c", (char *) __pyx_t_4);
4679  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 63, __pyx_L1_error)
4680  __Pyx_GOTREF(__pyx_t_7);
4681  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4682  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4683  __pyx_t_14 = NULL;
4684  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
4685  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
4686  if (likely(__pyx_t_14)) {
4687  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
4688  __Pyx_INCREF(__pyx_t_14);
4689  __Pyx_INCREF(function);
4690  __Pyx_DECREF_SET(__pyx_t_13, function);
4691  }
4692  }
4693  __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
4694  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4695  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4696  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 63, __pyx_L1_error)
4697  __Pyx_GOTREF(__pyx_t_10);
4698  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4699 
4700  /* "cpartitioning.pyx":56
4701  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4702  * return (
4703  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4704  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4705  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4706  */
4707  __pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 56, __pyx_L1_error)
4708  __Pyx_GOTREF(__pyx_t_13);
4709  __Pyx_GIVEREF(__pyx_t_1);
4710  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
4711  __Pyx_GIVEREF(__pyx_t_3);
4712  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
4713  __Pyx_GIVEREF(__pyx_t_5);
4714  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
4715  __Pyx_GIVEREF(__pyx_t_2);
4716  PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
4717  __Pyx_GIVEREF(__pyx_t_9);
4718  PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
4719  __Pyx_GIVEREF(__pyx_t_8);
4720  PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
4721  __Pyx_GIVEREF(__pyx_t_11);
4722  PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
4723  __Pyx_GIVEREF(__pyx_t_10);
4724  PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
4725  __pyx_t_1 = 0;
4726  __pyx_t_3 = 0;
4727  __pyx_t_5 = 0;
4728  __pyx_t_2 = 0;
4729  __pyx_t_9 = 0;
4730  __pyx_t_8 = 0;
4731  __pyx_t_11 = 0;
4732  __pyx_t_10 = 0;
4733  __pyx_r = __pyx_t_13;
4734  __pyx_t_13 = 0;
4735  goto __pyx_L0;
4736 
4737  /* "cpartitioning.pyx":52
4738  * )
4739  *
4740  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4741  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4742  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4743  */
4744 
4745  /* function exit code */
4746  __pyx_L1_error:;
4747  __Pyx_XDECREF(__pyx_t_1);
4748  __Pyx_XDECREF(__pyx_t_2);
4749  __Pyx_XDECREF(__pyx_t_3);
4750  __Pyx_XDECREF(__pyx_t_5);
4751  __Pyx_XDECREF(((PyObject *)__pyx_t_7));
4752  __Pyx_XDECREF(__pyx_t_8);
4753  __Pyx_XDECREF(__pyx_t_9);
4754  __Pyx_XDECREF(__pyx_t_10);
4755  __Pyx_XDECREF(__pyx_t_11);
4756  __Pyx_XDECREF(__pyx_t_12);
4757  __Pyx_XDECREF(__pyx_t_13);
4758  __Pyx_XDECREF(__pyx_t_14);
4759  __Pyx_AddTraceback("cpartitioning.convertPUMIPartitionToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4760  __pyx_r = NULL;
4761  __pyx_L0:;
4762  __Pyx_XGIVEREF(__pyx_r);
4763  __Pyx_RefNannyFinishContext();
4764  return __pyx_r;
4765 }
4766 
4767 /* "cpartitioning.pyx":66
4768  * )
4769  *
4770  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4771  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4772  * if not isinstance(filebase, bytes):
4773  */
4774 
4775 /* Python wrapper */
4776 static PyObject *__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4777 static PyMethodDef __pyx_mdef_13cpartitioning_7partitionNodesFromTetgenFiles = {"partitionNodesFromTetgenFiles", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles, METH_VARARGS|METH_KEYWORDS, 0};
4778 static PyObject *__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4779  struct PyMPICommObject *__pyx_v_comm = 0;
4780  PyObject *__pyx_v_filebase = 0;
4781  int __pyx_v_indexBase;
4782  int __pyx_v_nLayersOfOverlap;
4783  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
4784  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
4785  int __pyx_lineno = 0;
4786  const char *__pyx_filename = NULL;
4787  int __pyx_clineno = 0;
4788  PyObject *__pyx_r = 0;
4789  __Pyx_RefNannyDeclarations
4790  __Pyx_RefNannySetupContext("partitionNodesFromTetgenFiles (wrapper)", 0);
4791  {
4792  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_filebase,&__pyx_n_s_indexBase,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
4793  PyObject* values[6] = {0,0,0,0,0,0};
4794  if (unlikely(__pyx_kwds)) {
4795  Py_ssize_t kw_args;
4796  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4797  switch (pos_args) {
4798  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4799  CYTHON_FALLTHROUGH;
4800  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4801  CYTHON_FALLTHROUGH;
4802  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4803  CYTHON_FALLTHROUGH;
4804  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4805  CYTHON_FALLTHROUGH;
4806  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4807  CYTHON_FALLTHROUGH;
4808  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4809  CYTHON_FALLTHROUGH;
4810  case 0: break;
4811  default: goto __pyx_L5_argtuple_error;
4812  }
4813  kw_args = PyDict_Size(__pyx_kwds);
4814  switch (pos_args) {
4815  case 0:
4816  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
4817  else goto __pyx_L5_argtuple_error;
4818  CYTHON_FALLTHROUGH;
4819  case 1:
4820  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filebase)) != 0)) kw_args--;
4821  else {
4822  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 1); __PYX_ERR(0, 66, __pyx_L3_error)
4823  }
4824  CYTHON_FALLTHROUGH;
4825  case 2:
4826  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indexBase)) != 0)) kw_args--;
4827  else {
4828  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 2); __PYX_ERR(0, 66, __pyx_L3_error)
4829  }
4830  CYTHON_FALLTHROUGH;
4831  case 3:
4832  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
4833  else {
4834  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 3); __PYX_ERR(0, 66, __pyx_L3_error)
4835  }
4836  CYTHON_FALLTHROUGH;
4837  case 4:
4838  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4839  else {
4840  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 4); __PYX_ERR(0, 66, __pyx_L3_error)
4841  }
4842  CYTHON_FALLTHROUGH;
4843  case 5:
4844  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
4845  else {
4846  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 5); __PYX_ERR(0, 66, __pyx_L3_error)
4847  }
4848  }
4849  if (unlikely(kw_args > 0)) {
4850  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partitionNodesFromTetgenFiles") < 0)) __PYX_ERR(0, 66, __pyx_L3_error)
4851  }
4852  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4853  goto __pyx_L5_argtuple_error;
4854  } else {
4855  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4856  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4857  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4858  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4859  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4860  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4861  }
4862  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
4863  __pyx_v_filebase = values[1];
4864  __pyx_v_indexBase = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_indexBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error)
4865  __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error)
4866  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[4]);
4867  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[5]);
4868  }
4869  goto __pyx_L4_argument_unpacking_done;
4870  __pyx_L5_argtuple_error:;
4871  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 66, __pyx_L3_error)
4872  __pyx_L3_error:;
4873  __Pyx_AddTraceback("cpartitioning.partitionNodesFromTetgenFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
4874  __Pyx_RefNannyFinishContext();
4875  return NULL;
4876  __pyx_L4_argument_unpacking_done:;
4877  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 66, __pyx_L1_error)
4878  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 66, __pyx_L1_error)
4879  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 66, __pyx_L1_error)
4880  __pyx_r = __pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(__pyx_self, __pyx_v_comm, __pyx_v_filebase, __pyx_v_indexBase, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
4881 
4882  /* function exit code */
4883  goto __pyx_L0;
4884  __pyx_L1_error:;
4885  __pyx_r = NULL;
4886  __pyx_L0:;
4887  __Pyx_RefNannyFinishContext();
4888  return __pyx_r;
4889 }
4890 
4891 static PyObject *__pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase, int __pyx_v_indexBase, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
4892  PyObject *__pyx_r = NULL;
4893  __Pyx_RefNannyDeclarations
4894  int __pyx_t_1;
4895  int __pyx_t_2;
4896  PyObject *__pyx_t_3 = NULL;
4897  PyObject *__pyx_t_4 = NULL;
4898  PyObject *__pyx_t_5 = NULL;
4899  char *__pyx_t_6;
4900  int *__pyx_t_7;
4901  PyObject *__pyx_t_8 = NULL;
4902  Py_ssize_t __pyx_t_9;
4903  struct __pyx_array_obj *__pyx_t_10 = NULL;
4904  PyObject *__pyx_t_11 = NULL;
4905  PyObject *__pyx_t_12 = NULL;
4906  PyObject *__pyx_t_13 = NULL;
4907  PyObject *__pyx_t_14 = NULL;
4908  PyObject *__pyx_t_15 = NULL;
4909  PyObject *__pyx_t_16 = NULL;
4910  PyObject *__pyx_t_17 = NULL;
4911  int __pyx_lineno = 0;
4912  const char *__pyx_filename = NULL;
4913  int __pyx_clineno = 0;
4914  __Pyx_RefNannySetupContext("partitionNodesFromTetgenFiles", 0);
4915  __Pyx_INCREF(__pyx_v_filebase);
4916 
4917  /* "cpartitioning.pyx":67
4918  *
4919  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4920  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
4921  * if not isinstance(filebase, bytes):
4922  * filebase = filebase.encode()
4923  */
4924  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
4925 
4926  /* "cpartitioning.pyx":68
4927  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4928  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4929  * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
4930  * filebase = filebase.encode()
4931  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
4932  */
4933  __pyx_t_1 = PyBytes_Check(__pyx_v_filebase);
4934  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
4935  if (__pyx_t_2) {
4936 
4937  /* "cpartitioning.pyx":69
4938  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4939  * if not isinstance(filebase, bytes):
4940  * filebase = filebase.encode() # <<<<<<<<<<<<<<
4941  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
4942  * <const char*>(<char*>filebase),
4943  */
4944  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filebase, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error)
4945  __Pyx_GOTREF(__pyx_t_4);
4946  __pyx_t_5 = NULL;
4947  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
4948  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
4949  if (likely(__pyx_t_5)) {
4950  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
4951  __Pyx_INCREF(__pyx_t_5);
4952  __Pyx_INCREF(function);
4953  __Pyx_DECREF_SET(__pyx_t_4, function);
4954  }
4955  }
4956  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
4957  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4958  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error)
4959  __Pyx_GOTREF(__pyx_t_3);
4960  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4961  __Pyx_DECREF_SET(__pyx_v_filebase, __pyx_t_3);
4962  __pyx_t_3 = 0;
4963 
4964  /* "cpartitioning.pyx":68
4965  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4966  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4967  * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
4968  * filebase = filebase.encode()
4969  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
4970  */
4971  }
4972 
4973  /* "cpartitioning.pyx":71
4974  * filebase = filebase.encode()
4975  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
4976  * <const char*>(<char*>filebase), # <<<<<<<<<<<<<<
4977  * indexBase,
4978  * cmesh.mesh,
4979  */
4980  __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filebase); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
4981 
4982  /* "cpartitioning.pyx":70
4983  * if not isinstance(filebase, bytes):
4984  * filebase = filebase.encode()
4985  * c_partitionNodesFromTetgenFiles(comm.ob_mpi, # <<<<<<<<<<<<<<
4986  * <const char*>(<char*>filebase),
4987  * indexBase,
4988  */
4989  (void)(proteus::partitionNodesFromTetgenFiles(__pyx_v_comm->ob_mpi, ((char const *)((char *)__pyx_t_6)), __pyx_v_indexBase, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
4990 
4991  /* "cpartitioning.pyx":75
4992  * cmesh.mesh,
4993  * nLayersOfOverlap)
4994  * return ( # <<<<<<<<<<<<<<
4995  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4996  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4997  */
4998  __Pyx_XDECREF(__pyx_r);
4999 
5000  /* "cpartitioning.pyx":76
5001  * nLayersOfOverlap)
5002  * return (
5003  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5004  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5005  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5006  */
5007  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
5008  __Pyx_GOTREF(__pyx_t_4);
5009  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
5010  __Pyx_GOTREF(__pyx_t_5);
5011  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5012  __pyx_t_7 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
5013  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
5014  __Pyx_GOTREF(__pyx_t_4);
5015  __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 76, __pyx_L1_error)
5016  __Pyx_GOTREF(__pyx_t_8);
5017  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5018  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L1_error)
5019  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5020  if (!__pyx_t_7) {
5021  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5022  __PYX_ERR(0, 76, __pyx_L1_error)
5023  }
5024  __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
5025  __Pyx_GOTREF(__pyx_t_4);
5026  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 76, __pyx_L1_error)
5027  __Pyx_GOTREF(__pyx_t_8);
5028  __pyx_t_10 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_4), (char *) "c", (char *) __pyx_t_7);
5029  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 76, __pyx_L1_error)
5030  __Pyx_GOTREF(__pyx_t_10);
5031  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5032  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5033  __pyx_t_4 = NULL;
5034  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
5035  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
5036  if (likely(__pyx_t_4)) {
5037  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5038  __Pyx_INCREF(__pyx_t_4);
5039  __Pyx_INCREF(function);
5040  __Pyx_DECREF_SET(__pyx_t_5, function);
5041  }
5042  }
5043  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_10));
5044  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5045  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5046  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
5047  __Pyx_GOTREF(__pyx_t_3);
5048  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5049 
5050  /* "cpartitioning.pyx":77
5051  * return (
5052  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5053  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
5054  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5055  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5056  */
5057  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
5058  __Pyx_GOTREF(__pyx_t_4);
5059  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 77, __pyx_L1_error)
5060  __Pyx_GOTREF(__pyx_t_8);
5061  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5062  __pyx_t_7 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
5063  if (!__pyx_t_7) {
5064  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5065  __PYX_ERR(0, 77, __pyx_L1_error)
5066  }
5067  __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 77, __pyx_L1_error)
5068  __Pyx_GOTREF(__pyx_t_11);
5069  __pyx_t_4 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
5070  __Pyx_GOTREF(__pyx_t_4);
5071  __pyx_t_10 = __pyx_array_new(__pyx_t_4, sizeof(int), PyBytes_AS_STRING(__pyx_t_11), (char *) "c", (char *) __pyx_t_7);
5072  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 77, __pyx_L1_error)
5073  __Pyx_GOTREF(__pyx_t_10);
5074  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5075  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5076  __pyx_t_11 = NULL;
5077  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
5078  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
5079  if (likely(__pyx_t_11)) {
5080  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
5081  __Pyx_INCREF(__pyx_t_11);
5082  __Pyx_INCREF(function);
5083  __Pyx_DECREF_SET(__pyx_t_8, function);
5084  }
5085  }
5086  __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_10));
5087  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5088  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5089  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
5090  __Pyx_GOTREF(__pyx_t_5);
5091  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5092 
5093  /* "cpartitioning.pyx":78
5094  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5095  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5096  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5097  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5098  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5099  */
5100  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
5101  __Pyx_GOTREF(__pyx_t_11);
5102  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error)
5103  __Pyx_GOTREF(__pyx_t_4);
5104  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5105  __pyx_t_7 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
5106  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
5107  __Pyx_GOTREF(__pyx_t_11);
5108  __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_t_11, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 78, __pyx_L1_error)
5109  __Pyx_GOTREF(__pyx_t_12);
5110  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5111  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L1_error)
5112  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5113  if (!__pyx_t_7) {
5114  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5115  __PYX_ERR(0, 78, __pyx_L1_error)
5116  }
5117  __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
5118  __Pyx_GOTREF(__pyx_t_11);
5119  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 78, __pyx_L1_error)
5120  __Pyx_GOTREF(__pyx_t_12);
5121  __pyx_t_10 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_11), (char *) "c", (char *) __pyx_t_7);
5122  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 78, __pyx_L1_error)
5123  __Pyx_GOTREF(__pyx_t_10);
5124  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5125  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5126  __pyx_t_11 = NULL;
5127  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5128  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
5129  if (likely(__pyx_t_11)) {
5130  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5131  __Pyx_INCREF(__pyx_t_11);
5132  __Pyx_INCREF(function);
5133  __Pyx_DECREF_SET(__pyx_t_4, function);
5134  }
5135  }
5136  __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_t_10));
5137  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5138  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5139  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 78, __pyx_L1_error)
5140  __Pyx_GOTREF(__pyx_t_8);
5141  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5142 
5143  /* "cpartitioning.pyx":79
5144  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5145  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5146  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
5147  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5148  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5149  */
5150  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 79, __pyx_L1_error)
5151  __Pyx_GOTREF(__pyx_t_11);
5152  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 79, __pyx_L1_error)
5153  __Pyx_GOTREF(__pyx_t_12);
5154  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5155  __pyx_t_7 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
5156  if (!__pyx_t_7) {
5157  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5158  __PYX_ERR(0, 79, __pyx_L1_error)
5159  }
5160  __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 79, __pyx_L1_error)
5161  __Pyx_GOTREF(__pyx_t_13);
5162  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 79, __pyx_L1_error)
5163  __Pyx_GOTREF(__pyx_t_11);
5164  __pyx_t_10 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_13), (char *) "c", (char *) __pyx_t_7);
5165  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 79, __pyx_L1_error)
5166  __Pyx_GOTREF(__pyx_t_10);
5167  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5168  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5169  __pyx_t_13 = NULL;
5170  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
5171  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
5172  if (likely(__pyx_t_13)) {
5173  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
5174  __Pyx_INCREF(__pyx_t_13);
5175  __Pyx_INCREF(function);
5176  __Pyx_DECREF_SET(__pyx_t_12, function);
5177  }
5178  }
5179  __pyx_t_4 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_12, ((PyObject *)__pyx_t_10));
5180  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5181  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5182  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
5183  __Pyx_GOTREF(__pyx_t_4);
5184  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5185 
5186  /* "cpartitioning.pyx":80
5187  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5188  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5189  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5190  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5191  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5192  */
5193  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 80, __pyx_L1_error)
5194  __Pyx_GOTREF(__pyx_t_13);
5195  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 80, __pyx_L1_error)
5196  __Pyx_GOTREF(__pyx_t_11);
5197  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5198  __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
5199  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 80, __pyx_L1_error)
5200  __Pyx_GOTREF(__pyx_t_13);
5201  __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_t_13, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 80, __pyx_L1_error)
5202  __Pyx_GOTREF(__pyx_t_14);
5203  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5204  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
5205  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5206  if (!__pyx_t_7) {
5207  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5208  __PYX_ERR(0, 80, __pyx_L1_error)
5209  }
5210  __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 80, __pyx_L1_error)
5211  __Pyx_GOTREF(__pyx_t_13);
5212  __pyx_t_14 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 80, __pyx_L1_error)
5213  __Pyx_GOTREF(__pyx_t_14);
5214  __pyx_t_10 = __pyx_array_new(__pyx_t_14, sizeof(int), PyBytes_AS_STRING(__pyx_t_13), (char *) "c", (char *) __pyx_t_7);
5215  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 80, __pyx_L1_error)
5216  __Pyx_GOTREF(__pyx_t_10);
5217  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5218  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5219  __pyx_t_13 = NULL;
5220  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
5221  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
5222  if (likely(__pyx_t_13)) {
5223  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
5224  __Pyx_INCREF(__pyx_t_13);
5225  __Pyx_INCREF(function);
5226  __Pyx_DECREF_SET(__pyx_t_11, function);
5227  }
5228  }
5229  __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_10));
5230  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5231  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5232  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 80, __pyx_L1_error)
5233  __Pyx_GOTREF(__pyx_t_12);
5234  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5235 
5236  /* "cpartitioning.pyx":81
5237  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5238  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5239  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
5240  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5241  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
5242  */
5243  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 81, __pyx_L1_error)
5244  __Pyx_GOTREF(__pyx_t_13);
5245  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 81, __pyx_L1_error)
5246  __Pyx_GOTREF(__pyx_t_14);
5247  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5248  __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
5249  if (!__pyx_t_7) {
5250  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5251  __PYX_ERR(0, 81, __pyx_L1_error)
5252  }
5253  __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 81, __pyx_L1_error)
5254  __Pyx_GOTREF(__pyx_t_15);
5255  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 81, __pyx_L1_error)
5256  __Pyx_GOTREF(__pyx_t_13);
5257  __pyx_t_10 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_15), (char *) "c", (char *) __pyx_t_7);
5258  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 81, __pyx_L1_error)
5259  __Pyx_GOTREF(__pyx_t_10);
5260  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5261  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5262  __pyx_t_15 = NULL;
5263  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
5264  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
5265  if (likely(__pyx_t_15)) {
5266  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
5267  __Pyx_INCREF(__pyx_t_15);
5268  __Pyx_INCREF(function);
5269  __Pyx_DECREF_SET(__pyx_t_14, function);
5270  }
5271  }
5272  __pyx_t_11 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_14, ((PyObject *)__pyx_t_10));
5273  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
5274  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5275  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 81, __pyx_L1_error)
5276  __Pyx_GOTREF(__pyx_t_11);
5277  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5278 
5279  /* "cpartitioning.pyx":82
5280  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5281  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5282  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5283  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
5284  * )
5285  */
5286  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 82, __pyx_L1_error)
5287  __Pyx_GOTREF(__pyx_t_15);
5288  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 82, __pyx_L1_error)
5289  __Pyx_GOTREF(__pyx_t_13);
5290  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5291  __pyx_t_7 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
5292  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 82, __pyx_L1_error)
5293  __Pyx_GOTREF(__pyx_t_15);
5294  __pyx_t_16 = __Pyx_PyInt_AddObjC(__pyx_t_15, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 82, __pyx_L1_error)
5295  __Pyx_GOTREF(__pyx_t_16);
5296  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5297  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_16); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error)
5298  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5299  if (!__pyx_t_7) {
5300  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5301  __PYX_ERR(0, 82, __pyx_L1_error)
5302  }
5303  __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 82, __pyx_L1_error)
5304  __Pyx_GOTREF(__pyx_t_15);
5305  __pyx_t_16 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 82, __pyx_L1_error)
5306  __Pyx_GOTREF(__pyx_t_16);
5307  __pyx_t_10 = __pyx_array_new(__pyx_t_16, sizeof(int), PyBytes_AS_STRING(__pyx_t_15), (char *) "c", (char *) __pyx_t_7);
5308  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 82, __pyx_L1_error)
5309  __Pyx_GOTREF(__pyx_t_10);
5310  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5311  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5312  __pyx_t_15 = NULL;
5313  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
5314  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13);
5315  if (likely(__pyx_t_15)) {
5316  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
5317  __Pyx_INCREF(__pyx_t_15);
5318  __Pyx_INCREF(function);
5319  __Pyx_DECREF_SET(__pyx_t_13, function);
5320  }
5321  }
5322  __pyx_t_14 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_10));
5323  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
5324  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5325  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 82, __pyx_L1_error)
5326  __Pyx_GOTREF(__pyx_t_14);
5327  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5328 
5329  /* "cpartitioning.pyx":83
5330  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5331  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5332  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
5333  * )
5334  *
5335  */
5336  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 83, __pyx_L1_error)
5337  __Pyx_GOTREF(__pyx_t_15);
5338  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 83, __pyx_L1_error)
5339  __Pyx_GOTREF(__pyx_t_16);
5340  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5341  __pyx_t_7 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
5342  if (!__pyx_t_7) {
5343  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5344  __PYX_ERR(0, 83, __pyx_L1_error)
5345  }
5346  __pyx_t_17 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 83, __pyx_L1_error)
5347  __Pyx_GOTREF(__pyx_t_17);
5348  __pyx_t_15 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 83, __pyx_L1_error)
5349  __Pyx_GOTREF(__pyx_t_15);
5350  __pyx_t_10 = __pyx_array_new(__pyx_t_15, sizeof(int), PyBytes_AS_STRING(__pyx_t_17), (char *) "c", (char *) __pyx_t_7);
5351  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 83, __pyx_L1_error)
5352  __Pyx_GOTREF(__pyx_t_10);
5353  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5354  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5355  __pyx_t_17 = NULL;
5356  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
5357  __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
5358  if (likely(__pyx_t_17)) {
5359  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
5360  __Pyx_INCREF(__pyx_t_17);
5361  __Pyx_INCREF(function);
5362  __Pyx_DECREF_SET(__pyx_t_16, function);
5363  }
5364  }
5365  __pyx_t_13 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_17, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_16, ((PyObject *)__pyx_t_10));
5366  __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
5367  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5368  if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 83, __pyx_L1_error)
5369  __Pyx_GOTREF(__pyx_t_13);
5370  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5371 
5372  /* "cpartitioning.pyx":76
5373  * nLayersOfOverlap)
5374  * return (
5375  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5376  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5377  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5378  */
5379  __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 76, __pyx_L1_error)
5380  __Pyx_GOTREF(__pyx_t_16);
5381  __Pyx_GIVEREF(__pyx_t_3);
5382  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3);
5383  __Pyx_GIVEREF(__pyx_t_5);
5384  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_5);
5385  __Pyx_GIVEREF(__pyx_t_8);
5386  PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_8);
5387  __Pyx_GIVEREF(__pyx_t_4);
5388  PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_4);
5389  __Pyx_GIVEREF(__pyx_t_12);
5390  PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_12);
5391  __Pyx_GIVEREF(__pyx_t_11);
5392  PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_11);
5393  __Pyx_GIVEREF(__pyx_t_14);
5394  PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_14);
5395  __Pyx_GIVEREF(__pyx_t_13);
5396  PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_13);
5397  __pyx_t_3 = 0;
5398  __pyx_t_5 = 0;
5399  __pyx_t_8 = 0;
5400  __pyx_t_4 = 0;
5401  __pyx_t_12 = 0;
5402  __pyx_t_11 = 0;
5403  __pyx_t_14 = 0;
5404  __pyx_t_13 = 0;
5405  __pyx_r = __pyx_t_16;
5406  __pyx_t_16 = 0;
5407  goto __pyx_L0;
5408 
5409  /* "cpartitioning.pyx":66
5410  * )
5411  *
5412  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
5413  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5414  * if not isinstance(filebase, bytes):
5415  */
5416 
5417  /* function exit code */
5418  __pyx_L1_error:;
5419  __Pyx_XDECREF(__pyx_t_3);
5420  __Pyx_XDECREF(__pyx_t_4);
5421  __Pyx_XDECREF(__pyx_t_5);
5422  __Pyx_XDECREF(__pyx_t_8);
5423  __Pyx_XDECREF(((PyObject *)__pyx_t_10));
5424  __Pyx_XDECREF(__pyx_t_11);
5425  __Pyx_XDECREF(__pyx_t_12);
5426  __Pyx_XDECREF(__pyx_t_13);
5427  __Pyx_XDECREF(__pyx_t_14);
5428  __Pyx_XDECREF(__pyx_t_15);
5429  __Pyx_XDECREF(__pyx_t_16);
5430  __Pyx_XDECREF(__pyx_t_17);
5431  __Pyx_AddTraceback("cpartitioning.partitionNodesFromTetgenFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
5432  __pyx_r = NULL;
5433  __pyx_L0:;
5434  __Pyx_XDECREF(__pyx_v_filebase);
5435  __Pyx_XGIVEREF(__pyx_r);
5436  __Pyx_RefNannyFinishContext();
5437  return __pyx_r;
5438 }
5439 
5440 /* "cpartitioning.pyx":86
5441  * )
5442  *
5443  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
5444  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5445  * if not isinstance(filebase, bytes):
5446  */
5447 
5448 /* Python wrapper */
5449 static PyObject *__pyx_pw_13cpartitioning_9partitionNodesFromTriangleFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5450 static PyMethodDef __pyx_mdef_13cpartitioning_9partitionNodesFromTriangleFiles = {"partitionNodesFromTriangleFiles", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_9partitionNodesFromTriangleFiles, METH_VARARGS|METH_KEYWORDS, 0};
5451 static PyObject *__pyx_pw_13cpartitioning_9partitionNodesFromTriangleFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5452  struct PyMPICommObject *__pyx_v_comm = 0;
5453  PyObject *__pyx_v_filebase = 0;
5454  int __pyx_v_indexBase;
5455  int __pyx_v_nLayersOfOverlap;
5456  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
5457  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
5458  int __pyx_lineno = 0;
5459  const char *__pyx_filename = NULL;
5460  int __pyx_clineno = 0;
5461  PyObject *__pyx_r = 0;
5462  __Pyx_RefNannyDeclarations
5463  __Pyx_RefNannySetupContext("partitionNodesFromTriangleFiles (wrapper)", 0);
5464  {
5465  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_filebase,&__pyx_n_s_indexBase,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
5466  PyObject* values[6] = {0,0,0,0,0,0};
5467  if (unlikely(__pyx_kwds)) {
5468  Py_ssize_t kw_args;
5469  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5470  switch (pos_args) {
5471  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5472  CYTHON_FALLTHROUGH;
5473  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5474  CYTHON_FALLTHROUGH;
5475  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5476  CYTHON_FALLTHROUGH;
5477  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5478  CYTHON_FALLTHROUGH;
5479  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5480  CYTHON_FALLTHROUGH;
5481  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5482  CYTHON_FALLTHROUGH;
5483  case 0: break;
5484  default: goto __pyx_L5_argtuple_error;
5485  }
5486  kw_args = PyDict_Size(__pyx_kwds);
5487  switch (pos_args) {
5488  case 0:
5489  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
5490  else goto __pyx_L5_argtuple_error;
5491  CYTHON_FALLTHROUGH;
5492  case 1:
5493  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filebase)) != 0)) kw_args--;
5494  else {
5495  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, 1); __PYX_ERR(0, 86, __pyx_L3_error)
5496  }
5497  CYTHON_FALLTHROUGH;
5498  case 2:
5499  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indexBase)) != 0)) kw_args--;
5500  else {
5501  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, 2); __PYX_ERR(0, 86, __pyx_L3_error)
5502  }
5503  CYTHON_FALLTHROUGH;
5504  case 3:
5505  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
5506  else {
5507  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, 3); __PYX_ERR(0, 86, __pyx_L3_error)
5508  }
5509  CYTHON_FALLTHROUGH;
5510  case 4:
5511  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
5512  else {
5513  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, 4); __PYX_ERR(0, 86, __pyx_L3_error)
5514  }
5515  CYTHON_FALLTHROUGH;
5516  case 5:
5517  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
5518  else {
5519  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, 5); __PYX_ERR(0, 86, __pyx_L3_error)
5520  }
5521  }
5522  if (unlikely(kw_args > 0)) {
5523  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partitionNodesFromTriangleFiles") < 0)) __PYX_ERR(0, 86, __pyx_L3_error)
5524  }
5525  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5526  goto __pyx_L5_argtuple_error;
5527  } else {
5528  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5529  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5530  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5531  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5532  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5533  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5534  }
5535  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
5536  __pyx_v_filebase = values[1];
5537  __pyx_v_indexBase = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_indexBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error)
5538  __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error)
5539  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[4]);
5540  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[5]);
5541  }
5542  goto __pyx_L4_argument_unpacking_done;
5543  __pyx_L5_argtuple_error:;
5544  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 86, __pyx_L3_error)
5545  __pyx_L3_error:;
5546  __Pyx_AddTraceback("cpartitioning.partitionNodesFromTriangleFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
5547  __Pyx_RefNannyFinishContext();
5548  return NULL;
5549  __pyx_L4_argument_unpacking_done:;
5550  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 86, __pyx_L1_error)
5551  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 86, __pyx_L1_error)
5552  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 86, __pyx_L1_error)
5553  __pyx_r = __pyx_pf_13cpartitioning_8partitionNodesFromTriangleFiles(__pyx_self, __pyx_v_comm, __pyx_v_filebase, __pyx_v_indexBase, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
5554 
5555  /* function exit code */
5556  goto __pyx_L0;
5557  __pyx_L1_error:;
5558  __pyx_r = NULL;
5559  __pyx_L0:;
5560  __Pyx_RefNannyFinishContext();
5561  return __pyx_r;
5562 }
5563 
5564 static PyObject *__pyx_pf_13cpartitioning_8partitionNodesFromTriangleFiles(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase, int __pyx_v_indexBase, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
5565  PyObject *__pyx_r = NULL;
5566  __Pyx_RefNannyDeclarations
5567  int __pyx_t_1;
5568  int __pyx_t_2;
5569  PyObject *__pyx_t_3 = NULL;
5570  PyObject *__pyx_t_4 = NULL;
5571  PyObject *__pyx_t_5 = NULL;
5572  char *__pyx_t_6;
5573  int *__pyx_t_7;
5574  PyObject *__pyx_t_8 = NULL;
5575  Py_ssize_t __pyx_t_9;
5576  struct __pyx_array_obj *__pyx_t_10 = NULL;
5577  PyObject *__pyx_t_11 = NULL;
5578  PyObject *__pyx_t_12 = NULL;
5579  PyObject *__pyx_t_13 = NULL;
5580  PyObject *__pyx_t_14 = NULL;
5581  PyObject *__pyx_t_15 = NULL;
5582  PyObject *__pyx_t_16 = NULL;
5583  PyObject *__pyx_t_17 = NULL;
5584  int __pyx_lineno = 0;
5585  const char *__pyx_filename = NULL;
5586  int __pyx_clineno = 0;
5587  __Pyx_RefNannySetupContext("partitionNodesFromTriangleFiles", 0);
5588  __Pyx_INCREF(__pyx_v_filebase);
5589 
5590  /* "cpartitioning.pyx":87
5591  *
5592  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
5593  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
5594  * if not isinstance(filebase, bytes):
5595  * filebase = filebase.encode()
5596  */
5597  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
5598 
5599  /* "cpartitioning.pyx":88
5600  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
5601  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5602  * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
5603  * filebase = filebase.encode()
5604  * c_partitionNodesFromTriangleFiles(comm.ob_mpi,
5605  */
5606  __pyx_t_1 = PyBytes_Check(__pyx_v_filebase);
5607  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
5608  if (__pyx_t_2) {
5609 
5610  /* "cpartitioning.pyx":89
5611  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5612  * if not isinstance(filebase, bytes):
5613  * filebase = filebase.encode() # <<<<<<<<<<<<<<
5614  * c_partitionNodesFromTriangleFiles(comm.ob_mpi,
5615  * <const char*>(<char*>filebase),
5616  */
5617  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filebase, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error)
5618  __Pyx_GOTREF(__pyx_t_4);
5619  __pyx_t_5 = NULL;
5620  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
5621  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
5622  if (likely(__pyx_t_5)) {
5623  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5624  __Pyx_INCREF(__pyx_t_5);
5625  __Pyx_INCREF(function);
5626  __Pyx_DECREF_SET(__pyx_t_4, function);
5627  }
5628  }
5629  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
5630  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5631  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
5632  __Pyx_GOTREF(__pyx_t_3);
5633  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5634  __Pyx_DECREF_SET(__pyx_v_filebase, __pyx_t_3);
5635  __pyx_t_3 = 0;
5636 
5637  /* "cpartitioning.pyx":88
5638  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
5639  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5640  * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
5641  * filebase = filebase.encode()
5642  * c_partitionNodesFromTriangleFiles(comm.ob_mpi,
5643  */
5644  }
5645 
5646  /* "cpartitioning.pyx":91
5647  * filebase = filebase.encode()
5648  * c_partitionNodesFromTriangleFiles(comm.ob_mpi,
5649  * <const char*>(<char*>filebase), # <<<<<<<<<<<<<<
5650  * indexBase,
5651  * cmesh.mesh,
5652  */
5653  __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filebase); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error)
5654 
5655  /* "cpartitioning.pyx":90
5656  * if not isinstance(filebase, bytes):
5657  * filebase = filebase.encode()
5658  * c_partitionNodesFromTriangleFiles(comm.ob_mpi, # <<<<<<<<<<<<<<
5659  * <const char*>(<char*>filebase),
5660  * indexBase,
5661  */
5662  (void)(proteus::partitionNodesFromTriangleFiles(__pyx_v_comm->ob_mpi, ((char const *)((char *)__pyx_t_6)), __pyx_v_indexBase, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
5663 
5664  /* "cpartitioning.pyx":95
5665  * cmesh.mesh,
5666  * nLayersOfOverlap)
5667  * return ( # <<<<<<<<<<<<<<
5668  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5669  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5670  */
5671  __Pyx_XDECREF(__pyx_r);
5672 
5673  /* "cpartitioning.pyx":96
5674  * nLayersOfOverlap)
5675  * return (
5676  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5677  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5678  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5679  */
5680  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
5681  __Pyx_GOTREF(__pyx_t_4);
5682  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
5683  __Pyx_GOTREF(__pyx_t_5);
5684  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5685  __pyx_t_7 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
5686  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
5687  __Pyx_GOTREF(__pyx_t_4);
5688  __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error)
5689  __Pyx_GOTREF(__pyx_t_8);
5690  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5691  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
5692  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5693  if (!__pyx_t_7) {
5694  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5695  __PYX_ERR(0, 96, __pyx_L1_error)
5696  }
5697  __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
5698  __Pyx_GOTREF(__pyx_t_4);
5699  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error)
5700  __Pyx_GOTREF(__pyx_t_8);
5701  __pyx_t_10 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_4), (char *) "c", (char *) __pyx_t_7);
5702  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 96, __pyx_L1_error)
5703  __Pyx_GOTREF(__pyx_t_10);
5704  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5705  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5706  __pyx_t_4 = NULL;
5707  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
5708  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
5709  if (likely(__pyx_t_4)) {
5710  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5711  __Pyx_INCREF(__pyx_t_4);
5712  __Pyx_INCREF(function);
5713  __Pyx_DECREF_SET(__pyx_t_5, function);
5714  }
5715  }
5716  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_10));
5717  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5718  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5719  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
5720  __Pyx_GOTREF(__pyx_t_3);
5721  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5722 
5723  /* "cpartitioning.pyx":97
5724  * return (
5725  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5726  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
5727  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5728  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5729  */
5730  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
5731  __Pyx_GOTREF(__pyx_t_4);
5732  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L1_error)
5733  __Pyx_GOTREF(__pyx_t_8);
5734  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5735  __pyx_t_7 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
5736  if (!__pyx_t_7) {
5737  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5738  __PYX_ERR(0, 97, __pyx_L1_error)
5739  }
5740  __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 97, __pyx_L1_error)
5741  __Pyx_GOTREF(__pyx_t_11);
5742  __pyx_t_4 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
5743  __Pyx_GOTREF(__pyx_t_4);
5744  __pyx_t_10 = __pyx_array_new(__pyx_t_4, sizeof(int), PyBytes_AS_STRING(__pyx_t_11), (char *) "c", (char *) __pyx_t_7);
5745  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 97, __pyx_L1_error)
5746  __Pyx_GOTREF(__pyx_t_10);
5747  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5748  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5749  __pyx_t_11 = NULL;
5750  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
5751  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
5752  if (likely(__pyx_t_11)) {
5753  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
5754  __Pyx_INCREF(__pyx_t_11);
5755  __Pyx_INCREF(function);
5756  __Pyx_DECREF_SET(__pyx_t_8, function);
5757  }
5758  }
5759  __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_10));
5760  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5761  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5762  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
5763  __Pyx_GOTREF(__pyx_t_5);
5764  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5765 
5766  /* "cpartitioning.pyx":98
5767  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5768  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5769  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5770  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5771  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5772  */
5773  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L1_error)
5774  __Pyx_GOTREF(__pyx_t_11);
5775  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
5776  __Pyx_GOTREF(__pyx_t_4);
5777  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5778  __pyx_t_7 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
5779  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L1_error)
5780  __Pyx_GOTREF(__pyx_t_11);
5781  __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_t_11, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 98, __pyx_L1_error)
5782  __Pyx_GOTREF(__pyx_t_12);
5783  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5784  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error)
5785  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5786  if (!__pyx_t_7) {
5787  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5788  __PYX_ERR(0, 98, __pyx_L1_error)
5789  }
5790  __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L1_error)
5791  __Pyx_GOTREF(__pyx_t_11);
5792  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 98, __pyx_L1_error)
5793  __Pyx_GOTREF(__pyx_t_12);
5794  __pyx_t_10 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_11), (char *) "c", (char *) __pyx_t_7);
5795  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 98, __pyx_L1_error)
5796  __Pyx_GOTREF(__pyx_t_10);
5797  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5798  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5799  __pyx_t_11 = NULL;
5800  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5801  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
5802  if (likely(__pyx_t_11)) {
5803  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5804  __Pyx_INCREF(__pyx_t_11);
5805  __Pyx_INCREF(function);
5806  __Pyx_DECREF_SET(__pyx_t_4, function);
5807  }
5808  }
5809  __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_t_10));
5810  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5811  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5812  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 98, __pyx_L1_error)
5813  __Pyx_GOTREF(__pyx_t_8);
5814  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5815 
5816  /* "cpartitioning.pyx":99
5817  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5818  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5819  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
5820  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5821  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5822  */
5823  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 99, __pyx_L1_error)
5824  __Pyx_GOTREF(__pyx_t_11);
5825  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 99, __pyx_L1_error)
5826  __Pyx_GOTREF(__pyx_t_12);
5827  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5828  __pyx_t_7 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
5829  if (!__pyx_t_7) {
5830  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5831  __PYX_ERR(0, 99, __pyx_L1_error)
5832  }
5833  __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 99, __pyx_L1_error)
5834  __Pyx_GOTREF(__pyx_t_13);
5835  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 99, __pyx_L1_error)
5836  __Pyx_GOTREF(__pyx_t_11);
5837  __pyx_t_10 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_13), (char *) "c", (char *) __pyx_t_7);
5838  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 99, __pyx_L1_error)
5839  __Pyx_GOTREF(__pyx_t_10);
5840  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5841  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5842  __pyx_t_13 = NULL;
5843  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
5844  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
5845  if (likely(__pyx_t_13)) {
5846  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
5847  __Pyx_INCREF(__pyx_t_13);
5848  __Pyx_INCREF(function);
5849  __Pyx_DECREF_SET(__pyx_t_12, function);
5850  }
5851  }
5852  __pyx_t_4 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_12, ((PyObject *)__pyx_t_10));
5853  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5854  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5855  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error)
5856  __Pyx_GOTREF(__pyx_t_4);
5857  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5858 
5859  /* "cpartitioning.pyx":100
5860  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5861  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5862  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5863  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5864  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5865  */
5866  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 100, __pyx_L1_error)
5867  __Pyx_GOTREF(__pyx_t_13);
5868  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 100, __pyx_L1_error)
5869  __Pyx_GOTREF(__pyx_t_11);
5870  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5871  __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
5872  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 100, __pyx_L1_error)
5873  __Pyx_GOTREF(__pyx_t_13);
5874  __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_t_13, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 100, __pyx_L1_error)
5875  __Pyx_GOTREF(__pyx_t_14);
5876  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5877  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error)
5878  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5879  if (!__pyx_t_7) {
5880  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5881  __PYX_ERR(0, 100, __pyx_L1_error)
5882  }
5883  __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 100, __pyx_L1_error)
5884  __Pyx_GOTREF(__pyx_t_13);
5885  __pyx_t_14 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 100, __pyx_L1_error)
5886  __Pyx_GOTREF(__pyx_t_14);
5887  __pyx_t_10 = __pyx_array_new(__pyx_t_14, sizeof(int), PyBytes_AS_STRING(__pyx_t_13), (char *) "c", (char *) __pyx_t_7);
5888  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 100, __pyx_L1_error)
5889  __Pyx_GOTREF(__pyx_t_10);
5890  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5891  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5892  __pyx_t_13 = NULL;
5893  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
5894  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
5895  if (likely(__pyx_t_13)) {
5896  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
5897  __Pyx_INCREF(__pyx_t_13);
5898  __Pyx_INCREF(function);
5899  __Pyx_DECREF_SET(__pyx_t_11, function);
5900  }
5901  }
5902  __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_10));
5903  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5904  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5905  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 100, __pyx_L1_error)
5906  __Pyx_GOTREF(__pyx_t_12);
5907  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5908 
5909  /* "cpartitioning.pyx":101
5910  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5911  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5912  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
5913  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5914  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
5915  */
5916  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 101, __pyx_L1_error)
5917  __Pyx_GOTREF(__pyx_t_13);
5918  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 101, __pyx_L1_error)
5919  __Pyx_GOTREF(__pyx_t_14);
5920  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5921  __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
5922  if (!__pyx_t_7) {
5923  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5924  __PYX_ERR(0, 101, __pyx_L1_error)
5925  }
5926  __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 101, __pyx_L1_error)
5927  __Pyx_GOTREF(__pyx_t_15);
5928  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 101, __pyx_L1_error)
5929  __Pyx_GOTREF(__pyx_t_13);
5930  __pyx_t_10 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_15), (char *) "c", (char *) __pyx_t_7);
5931  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 101, __pyx_L1_error)
5932  __Pyx_GOTREF(__pyx_t_10);
5933  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5934  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5935  __pyx_t_15 = NULL;
5936  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
5937  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
5938  if (likely(__pyx_t_15)) {
5939  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
5940  __Pyx_INCREF(__pyx_t_15);
5941  __Pyx_INCREF(function);
5942  __Pyx_DECREF_SET(__pyx_t_14, function);
5943  }
5944  }
5945  __pyx_t_11 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_14, ((PyObject *)__pyx_t_10));
5946  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
5947  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5948  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 101, __pyx_L1_error)
5949  __Pyx_GOTREF(__pyx_t_11);
5950  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5951 
5952  /* "cpartitioning.pyx":102
5953  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5954  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5955  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5956  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
5957  * )
5958  */
5959  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 102, __pyx_L1_error)
5960  __Pyx_GOTREF(__pyx_t_15);
5961  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 102, __pyx_L1_error)
5962  __Pyx_GOTREF(__pyx_t_13);
5963  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5964  __pyx_t_7 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
5965  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 102, __pyx_L1_error)
5966  __Pyx_GOTREF(__pyx_t_15);
5967  __pyx_t_16 = __Pyx_PyInt_AddObjC(__pyx_t_15, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 102, __pyx_L1_error)
5968  __Pyx_GOTREF(__pyx_t_16);
5969  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5970  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_16); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error)
5971  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5972  if (!__pyx_t_7) {
5973  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5974  __PYX_ERR(0, 102, __pyx_L1_error)
5975  }
5976  __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 102, __pyx_L1_error)
5977  __Pyx_GOTREF(__pyx_t_15);
5978  __pyx_t_16 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 102, __pyx_L1_error)
5979  __Pyx_GOTREF(__pyx_t_16);
5980  __pyx_t_10 = __pyx_array_new(__pyx_t_16, sizeof(int), PyBytes_AS_STRING(__pyx_t_15), (char *) "c", (char *) __pyx_t_7);
5981  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 102, __pyx_L1_error)
5982  __Pyx_GOTREF(__pyx_t_10);
5983  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5984  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5985  __pyx_t_15 = NULL;
5986  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
5987  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13);
5988  if (likely(__pyx_t_15)) {
5989  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
5990  __Pyx_INCREF(__pyx_t_15);
5991  __Pyx_INCREF(function);
5992  __Pyx_DECREF_SET(__pyx_t_13, function);
5993  }
5994  }
5995  __pyx_t_14 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_10));
5996  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
5997  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5998  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 102, __pyx_L1_error)
5999  __Pyx_GOTREF(__pyx_t_14);
6000  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6001 
6002  /* "cpartitioning.pyx":103
6003  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
6004  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
6005  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
6006  * )
6007  *
6008  */
6009  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L1_error)
6010  __Pyx_GOTREF(__pyx_t_15);
6011  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 103, __pyx_L1_error)
6012  __Pyx_GOTREF(__pyx_t_16);
6013  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6014  __pyx_t_7 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
6015  if (!__pyx_t_7) {
6016  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
6017  __PYX_ERR(0, 103, __pyx_L1_error)
6018  }
6019  __pyx_t_17 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 103, __pyx_L1_error)
6020  __Pyx_GOTREF(__pyx_t_17);
6021  __pyx_t_15 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L1_error)
6022  __Pyx_GOTREF(__pyx_t_15);
6023  __pyx_t_10 = __pyx_array_new(__pyx_t_15, sizeof(int), PyBytes_AS_STRING(__pyx_t_17), (char *) "c", (char *) __pyx_t_7);
6024  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 103, __pyx_L1_error)
6025  __Pyx_GOTREF(__pyx_t_10);
6026  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6027  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6028  __pyx_t_17 = NULL;
6029  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
6030  __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
6031  if (likely(__pyx_t_17)) {
6032  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
6033  __Pyx_INCREF(__pyx_t_17);
6034  __Pyx_INCREF(function);
6035  __Pyx_DECREF_SET(__pyx_t_16, function);
6036  }
6037  }
6038  __pyx_t_13 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_17, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_16, ((PyObject *)__pyx_t_10));
6039  __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
6040  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
6041  if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 103, __pyx_L1_error)
6042  __Pyx_GOTREF(__pyx_t_13);
6043  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6044 
6045  /* "cpartitioning.pyx":96
6046  * nLayersOfOverlap)
6047  * return (
6048  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
6049  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
6050  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
6051  */
6052  __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 96, __pyx_L1_error)
6053  __Pyx_GOTREF(__pyx_t_16);
6054  __Pyx_GIVEREF(__pyx_t_3);
6055  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3);
6056  __Pyx_GIVEREF(__pyx_t_5);
6057  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_5);
6058  __Pyx_GIVEREF(__pyx_t_8);
6059  PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_8);
6060  __Pyx_GIVEREF(__pyx_t_4);
6061  PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_4);
6062  __Pyx_GIVEREF(__pyx_t_12);
6063  PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_12);
6064  __Pyx_GIVEREF(__pyx_t_11);
6065  PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_11);
6066  __Pyx_GIVEREF(__pyx_t_14);
6067  PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_14);
6068  __Pyx_GIVEREF(__pyx_t_13);
6069  PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_13);
6070  __pyx_t_3 = 0;
6071  __pyx_t_5 = 0;
6072  __pyx_t_8 = 0;
6073  __pyx_t_4 = 0;
6074  __pyx_t_12 = 0;
6075  __pyx_t_11 = 0;
6076  __pyx_t_14 = 0;
6077  __pyx_t_13 = 0;
6078  __pyx_r = __pyx_t_16;
6079  __pyx_t_16 = 0;
6080  goto __pyx_L0;
6081 
6082  /* "cpartitioning.pyx":86
6083  * )
6084  *
6085  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
6086  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
6087  * if not isinstance(filebase, bytes):
6088  */
6089 
6090  /* function exit code */
6091  __pyx_L1_error:;
6092  __Pyx_XDECREF(__pyx_t_3);
6093  __Pyx_XDECREF(__pyx_t_4);
6094  __Pyx_XDECREF(__pyx_t_5);
6095  __Pyx_XDECREF(__pyx_t_8);
6096  __Pyx_XDECREF(((PyObject *)__pyx_t_10));
6097  __Pyx_XDECREF(__pyx_t_11);
6098  __Pyx_XDECREF(__pyx_t_12);
6099  __Pyx_XDECREF(__pyx_t_13);
6100  __Pyx_XDECREF(__pyx_t_14);
6101  __Pyx_XDECREF(__pyx_t_15);
6102  __Pyx_XDECREF(__pyx_t_16);
6103  __Pyx_XDECREF(__pyx_t_17);
6104  __Pyx_AddTraceback("cpartitioning.partitionNodesFromTriangleFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
6105  __pyx_r = NULL;
6106  __pyx_L0:;
6107  __Pyx_XDECREF(__pyx_v_filebase);
6108  __Pyx_XGIVEREF(__pyx_r);
6109  __Pyx_RefNannyFinishContext();
6110  return __pyx_r;
6111 }
6112 
6113 /* "cpartitioning.pyx":106
6114  * )
6115  *
6116  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
6117  * int nSpace,
6118  * cmeshTools.CMesh cmesh,
6119  */
6120 
6121 /* Python wrapper */
6122 static PyObject *__pyx_pw_13cpartitioning_11buildQuadraticLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6123 static PyMethodDef __pyx_mdef_13cpartitioning_11buildQuadraticLocal2GlobalMappings = {"buildQuadraticLocal2GlobalMappings", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_11buildQuadraticLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
6124 static PyObject *__pyx_pw_13cpartitioning_11buildQuadraticLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6125  struct PyMPICommObject *__pyx_v_comm = 0;
6126  int __pyx_v_nSpace;
6127  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
6128  CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
6129  PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
6130  PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned = 0;
6131  PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned = 0;
6132  PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned = 0;
6133  PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
6134  PyArrayObject *__pyx_v_nodeNumbering_subdomain2global = 0;
6135  PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global = 0;
6136  PyArrayObject *__pyx_v_edgeNumbering_subdomain2global = 0;
6137  PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned = 0;
6138  PyArrayObject *__pyx_v_quadratic_subdomain_l2g = 0;
6139  PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global = 0;
6140  PyArrayObject *__pyx_v_quadratic_lagrangeNodes = 0;
6141  int __pyx_lineno = 0;
6142  const char *__pyx_filename = NULL;
6143  int __pyx_clineno = 0;
6144  PyObject *__pyx_r = 0;
6145  __Pyx_RefNannyDeclarations
6146  __Pyx_RefNannySetupContext("buildQuadraticLocal2GlobalMappings (wrapper)", 0);
6147  {
6148  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nSpace,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_nodeOffsets_subdomain_owned,&__pyx_n_s_elementBoundaryOffsets_subdomain,&__pyx_n_s_edgeOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_nodeNumbering_subdomain2global,&__pyx_n_s_elementBoundaryNumbering_subdoma,&__pyx_n_s_edgeNumbering_subdomain2global,&__pyx_n_s_quadratic_dof_offsets_subdomain,&__pyx_n_s_quadratic_subdomain_l2g,&__pyx_n_s_quadraticNumbering_subdomain2glo,&__pyx_n_s_quadratic_lagrangeNodes,0};
6149  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
6150  if (unlikely(__pyx_kwds)) {
6151  Py_ssize_t kw_args;
6152  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6153  switch (pos_args) {
6154  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6155  CYTHON_FALLTHROUGH;
6156  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6157  CYTHON_FALLTHROUGH;
6158  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6159  CYTHON_FALLTHROUGH;
6160  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6161  CYTHON_FALLTHROUGH;
6162  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6163  CYTHON_FALLTHROUGH;
6164  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6165  CYTHON_FALLTHROUGH;
6166  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6167  CYTHON_FALLTHROUGH;
6168  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6169  CYTHON_FALLTHROUGH;
6170  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6171  CYTHON_FALLTHROUGH;
6172  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6173  CYTHON_FALLTHROUGH;
6174  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6175  CYTHON_FALLTHROUGH;
6176  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6177  CYTHON_FALLTHROUGH;
6178  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6179  CYTHON_FALLTHROUGH;
6180  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6181  CYTHON_FALLTHROUGH;
6182  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6183  CYTHON_FALLTHROUGH;
6184  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6185  CYTHON_FALLTHROUGH;
6186  case 0: break;
6187  default: goto __pyx_L5_argtuple_error;
6188  }
6189  kw_args = PyDict_Size(__pyx_kwds);
6190  switch (pos_args) {
6191  case 0:
6192  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
6193  else goto __pyx_L5_argtuple_error;
6194  CYTHON_FALLTHROUGH;
6195  case 1:
6196  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
6197  else {
6198  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 1); __PYX_ERR(0, 106, __pyx_L3_error)
6199  }
6200  CYTHON_FALLTHROUGH;
6201  case 2:
6202  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
6203  else {
6204  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 2); __PYX_ERR(0, 106, __pyx_L3_error)
6205  }
6206  CYTHON_FALLTHROUGH;
6207  case 3:
6208  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
6209  else {
6210  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 3); __PYX_ERR(0, 106, __pyx_L3_error)
6211  }
6212  CYTHON_FALLTHROUGH;
6213  case 4:
6214  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
6215  else {
6216  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 4); __PYX_ERR(0, 106, __pyx_L3_error)
6217  }
6218  CYTHON_FALLTHROUGH;
6219  case 5:
6220  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeOffsets_subdomain_owned)) != 0)) kw_args--;
6221  else {
6222  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 5); __PYX_ERR(0, 106, __pyx_L3_error)
6223  }
6224  CYTHON_FALLTHROUGH;
6225  case 6:
6226  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryOffsets_subdomain)) != 0)) kw_args--;
6227  else {
6228  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 6); __PYX_ERR(0, 106, __pyx_L3_error)
6229  }
6230  CYTHON_FALLTHROUGH;
6231  case 7:
6232  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeOffsets_subdomain_owned)) != 0)) kw_args--;
6233  else {
6234  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 7); __PYX_ERR(0, 106, __pyx_L3_error)
6235  }
6236  CYTHON_FALLTHROUGH;
6237  case 8:
6238  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
6239  else {
6240  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 8); __PYX_ERR(0, 106, __pyx_L3_error)
6241  }
6242  CYTHON_FALLTHROUGH;
6243  case 9:
6244  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeNumbering_subdomain2global)) != 0)) kw_args--;
6245  else {
6246  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 9); __PYX_ERR(0, 106, __pyx_L3_error)
6247  }
6248  CYTHON_FALLTHROUGH;
6249  case 10:
6250  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryNumbering_subdoma)) != 0)) kw_args--;
6251  else {
6252  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 10); __PYX_ERR(0, 106, __pyx_L3_error)
6253  }
6254  CYTHON_FALLTHROUGH;
6255  case 11:
6256  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeNumbering_subdomain2global)) != 0)) kw_args--;
6257  else {
6258  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 11); __PYX_ERR(0, 106, __pyx_L3_error)
6259  }
6260  CYTHON_FALLTHROUGH;
6261  case 12:
6262  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_dof_offsets_subdomain)) != 0)) kw_args--;
6263  else {
6264  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 12); __PYX_ERR(0, 106, __pyx_L3_error)
6265  }
6266  CYTHON_FALLTHROUGH;
6267  case 13:
6268  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_subdomain_l2g)) != 0)) kw_args--;
6269  else {
6270  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 13); __PYX_ERR(0, 106, __pyx_L3_error)
6271  }
6272  CYTHON_FALLTHROUGH;
6273  case 14:
6274  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadraticNumbering_subdomain2glo)) != 0)) kw_args--;
6275  else {
6276  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 14); __PYX_ERR(0, 106, __pyx_L3_error)
6277  }
6278  CYTHON_FALLTHROUGH;
6279  case 15:
6280  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_lagrangeNodes)) != 0)) kw_args--;
6281  else {
6282  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 15); __PYX_ERR(0, 106, __pyx_L3_error)
6283  }
6284  }
6285  if (unlikely(kw_args > 0)) {
6286  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildQuadraticLocal2GlobalMappings") < 0)) __PYX_ERR(0, 106, __pyx_L3_error)
6287  }
6288  } else if (PyTuple_GET_SIZE(__pyx_args) != 16) {
6289  goto __pyx_L5_argtuple_error;
6290  } else {
6291  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6292  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6293  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6294  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6295  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6296  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6297  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6298  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6299  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6300  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6301  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6302  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6303  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6304  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6305  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6306  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6307  }
6308  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
6309  __pyx_v_nSpace = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nSpace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L3_error)
6310  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
6311  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
6312  __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
6313  __pyx_v_nodeOffsets_subdomain_owned = ((PyArrayObject *)values[5]);
6314  __pyx_v_elementBoundaryOffsets_subdomain_owned = ((PyArrayObject *)values[6]);
6315  __pyx_v_edgeOffsets_subdomain_owned = ((PyArrayObject *)values[7]);
6316  __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[8]);
6317  __pyx_v_nodeNumbering_subdomain2global = ((PyArrayObject *)values[9]);
6318  __pyx_v_elementBoundaryNumbering_subdomain2global = ((PyArrayObject *)values[10]);
6319  __pyx_v_edgeNumbering_subdomain2global = ((PyArrayObject *)values[11]);
6320  __pyx_v_quadratic_dof_offsets_subdomain_owned = ((PyArrayObject *)values[12]);
6321  __pyx_v_quadratic_subdomain_l2g = ((PyArrayObject *)values[13]);
6322  __pyx_v_quadraticNumbering_subdomain2global = ((PyArrayObject *)values[14]);
6323  __pyx_v_quadratic_lagrangeNodes = ((PyArrayObject *)values[15]);
6324  }
6325  goto __pyx_L4_argument_unpacking_done;
6326  __pyx_L5_argtuple_error:;
6327  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 106, __pyx_L3_error)
6328  __pyx_L3_error:;
6329  __Pyx_AddTraceback("cpartitioning.buildQuadraticLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6330  __Pyx_RefNannyFinishContext();
6331  return NULL;
6332  __pyx_L4_argument_unpacking_done:;
6333  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 106, __pyx_L1_error)
6334  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 108, __pyx_L1_error)
6335  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 109, __pyx_L1_error)
6336  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 110, __pyx_L1_error)
6337  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "nodeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 111, __pyx_L1_error)
6338  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryOffsets_subdomain_owned", 0))) __PYX_ERR(0, 112, __pyx_L1_error)
6339  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "edgeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 113, __pyx_L1_error)
6340  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 114, __pyx_L1_error)
6341  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "nodeNumbering_subdomain2global", 0))) __PYX_ERR(0, 115, __pyx_L1_error)
6342  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryNumbering_subdomain2global", 0))) __PYX_ERR(0, 116, __pyx_L1_error)
6343  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "edgeNumbering_subdomain2global", 0))) __PYX_ERR(0, 117, __pyx_L1_error)
6344  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_dof_offsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "quadratic_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 118, __pyx_L1_error)
6345  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_subdomain_l2g), __pyx_ptype_5numpy_ndarray, 1, "quadratic_subdomain_l2g", 0))) __PYX_ERR(0, 119, __pyx_L1_error)
6346  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadraticNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "quadraticNumbering_subdomain2global", 0))) __PYX_ERR(0, 120, __pyx_L1_error)
6347  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_lagrangeNodes), __pyx_ptype_5numpy_ndarray, 1, "quadratic_lagrangeNodes", 0))) __PYX_ERR(0, 121, __pyx_L1_error)
6348  __pyx_r = __pyx_pf_13cpartitioning_10buildQuadraticLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nSpace, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_nodeOffsets_subdomain_owned, __pyx_v_elementBoundaryOffsets_subdomain_owned, __pyx_v_edgeOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_edgeNumbering_subdomain2global, __pyx_v_quadratic_dof_offsets_subdomain_owned, __pyx_v_quadratic_subdomain_l2g, __pyx_v_quadraticNumbering_subdomain2global, __pyx_v_quadratic_lagrangeNodes);
6349 
6350  /* function exit code */
6351  goto __pyx_L0;
6352  __pyx_L1_error:;
6353  __pyx_r = NULL;
6354  __pyx_L0:;
6355  __Pyx_RefNannyFinishContext();
6356  return __pyx_r;
6357 }
6358 
6359 static PyObject *__pyx_pf_13cpartitioning_10buildQuadraticLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes) {
6360  int __pyx_v_nDOF_all_processes;
6361  int __pyx_v_nDOF_subdomain;
6362  int __pyx_v_max_dof_neighbors;
6363  PyObject *__pyx_r = NULL;
6364  __Pyx_RefNannyDeclarations
6365  PyObject *__pyx_t_1 = NULL;
6366  PyObject *__pyx_t_2 = NULL;
6367  PyObject *__pyx_t_3 = NULL;
6368  PyObject *__pyx_t_4 = NULL;
6369  int __pyx_lineno = 0;
6370  const char *__pyx_filename = NULL;
6371  int __pyx_clineno = 0;
6372  __Pyx_RefNannySetupContext("buildQuadraticLocal2GlobalMappings", 0);
6373 
6374  /* "cpartitioning.pyx":122
6375  * np.ndarray quadraticNumbering_subdomain2global,
6376  * np.ndarray quadratic_lagrangeNodes):
6377  * cdef int nDOF_all_processes=0 # <<<<<<<<<<<<<<
6378  * cdef int nDOF_subdomain=0
6379  * cdef int max_dof_neighbors=0
6380  */
6381  __pyx_v_nDOF_all_processes = 0;
6382 
6383  /* "cpartitioning.pyx":123
6384  * np.ndarray quadratic_lagrangeNodes):
6385  * cdef int nDOF_all_processes=0
6386  * cdef int nDOF_subdomain=0 # <<<<<<<<<<<<<<
6387  * cdef int max_dof_neighbors=0
6388  * if nSpace == 1:
6389  */
6390  __pyx_v_nDOF_subdomain = 0;
6391 
6392  /* "cpartitioning.pyx":124
6393  * cdef int nDOF_all_processes=0
6394  * cdef int nDOF_subdomain=0
6395  * cdef int max_dof_neighbors=0 # <<<<<<<<<<<<<<
6396  * if nSpace == 1:
6397  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi,
6398  */
6399  __pyx_v_max_dof_neighbors = 0;
6400 
6401  /* "cpartitioning.pyx":125
6402  * cdef int nDOF_subdomain=0
6403  * cdef int max_dof_neighbors=0
6404  * if nSpace == 1: # <<<<<<<<<<<<<<
6405  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi,
6406  * cmesh.mesh,
6407  */
6408  switch (__pyx_v_nSpace) {
6409  case 1:
6410 
6411  /* "cpartitioning.pyx":126
6412  * cdef int max_dof_neighbors=0
6413  * if nSpace == 1:
6414  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi, # <<<<<<<<<<<<<<
6415  * cmesh.mesh,
6416  * <int*>(elementOffsets_subdomain_owned.data),
6417  */
6418  (void)(proteus::buildQuadraticSubdomain2GlobalMappings_1d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_elementOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_elementNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
6419 
6420  /* "cpartitioning.pyx":125
6421  * cdef int nDOF_subdomain=0
6422  * cdef int max_dof_neighbors=0
6423  * if nSpace == 1: # <<<<<<<<<<<<<<
6424  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi,
6425  * cmesh.mesh,
6426  */
6427  break;
6428  case 2:
6429 
6430  /* "cpartitioning.pyx":140
6431  * <double*>(quadratic_lagrangeNodes.data));
6432  * elif nSpace == 2:
6433  * buildQuadraticSubdomain2GlobalMappings_2d(comm.ob_mpi, # <<<<<<<<<<<<<<
6434  * cmesh.mesh,
6435  * <int*>(elementBoundaryOffsets_subdomain_owned.data),
6436  */
6437  (void)(proteus::buildQuadraticSubdomain2GlobalMappings_2d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_elementBoundaryOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_elementBoundaryNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
6438 
6439  /* "cpartitioning.pyx":139
6440  * <int*>(quadraticNumbering_subdomain2global.data),
6441  * <double*>(quadratic_lagrangeNodes.data));
6442  * elif nSpace == 2: # <<<<<<<<<<<<<<
6443  * buildQuadraticSubdomain2GlobalMappings_2d(comm.ob_mpi,
6444  * cmesh.mesh,
6445  */
6446  break;
6447  default:
6448 
6449  /* "cpartitioning.pyx":154
6450  * <double*>(quadratic_lagrangeNodes.data))
6451  * else:
6452  * buildQuadraticSubdomain2GlobalMappings_3d(comm.ob_mpi, # <<<<<<<<<<<<<<
6453  * cmesh.mesh,
6454  * <int*>(edgeOffsets_subdomain_owned.data),
6455  */
6456  (void)(proteus::buildQuadraticSubdomain2GlobalMappings_3d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_edgeOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_edgeNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
6457  break;
6458  }
6459 
6460  /* "cpartitioning.pyx":167
6461  * <int*>(quadraticNumbering_subdomain2global.data),
6462  * <double*>(quadratic_lagrangeNodes.data))
6463  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
6464  * nDOF_subdomain,
6465  * max_dof_neighbors)
6466  */
6467  __Pyx_XDECREF(__pyx_r);
6468  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nDOF_all_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
6469  __Pyx_GOTREF(__pyx_t_1);
6470 
6471  /* "cpartitioning.pyx":168
6472  * <double*>(quadratic_lagrangeNodes.data))
6473  * return (nDOF_all_processes,
6474  * nDOF_subdomain, # <<<<<<<<<<<<<<
6475  * max_dof_neighbors)
6476  *
6477  */
6478  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nDOF_subdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
6479  __Pyx_GOTREF(__pyx_t_2);
6480 
6481  /* "cpartitioning.pyx":169
6482  * return (nDOF_all_processes,
6483  * nDOF_subdomain,
6484  * max_dof_neighbors) # <<<<<<<<<<<<<<
6485  *
6486  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm,
6487  */
6488  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_dof_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
6489  __Pyx_GOTREF(__pyx_t_3);
6490 
6491  /* "cpartitioning.pyx":167
6492  * <int*>(quadraticNumbering_subdomain2global.data),
6493  * <double*>(quadratic_lagrangeNodes.data))
6494  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
6495  * nDOF_subdomain,
6496  * max_dof_neighbors)
6497  */
6498  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
6499  __Pyx_GOTREF(__pyx_t_4);
6500  __Pyx_GIVEREF(__pyx_t_1);
6501  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6502  __Pyx_GIVEREF(__pyx_t_2);
6503  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
6504  __Pyx_GIVEREF(__pyx_t_3);
6505  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
6506  __pyx_t_1 = 0;
6507  __pyx_t_2 = 0;
6508  __pyx_t_3 = 0;
6509  __pyx_r = __pyx_t_4;
6510  __pyx_t_4 = 0;
6511  goto __pyx_L0;
6512 
6513  /* "cpartitioning.pyx":106
6514  * )
6515  *
6516  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
6517  * int nSpace,
6518  * cmeshTools.CMesh cmesh,
6519  */
6520 
6521  /* function exit code */
6522  __pyx_L1_error:;
6523  __Pyx_XDECREF(__pyx_t_1);
6524  __Pyx_XDECREF(__pyx_t_2);
6525  __Pyx_XDECREF(__pyx_t_3);
6526  __Pyx_XDECREF(__pyx_t_4);
6527  __Pyx_AddTraceback("cpartitioning.buildQuadraticLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6528  __pyx_r = NULL;
6529  __pyx_L0:;
6530  __Pyx_XGIVEREF(__pyx_r);
6531  __Pyx_RefNannyFinishContext();
6532  return __pyx_r;
6533 }
6534 
6535 /* "cpartitioning.pyx":171
6536  * max_dof_neighbors)
6537  *
6538  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
6539  * int nSpace,
6540  * cmeshTools.CMesh cmesh,
6541  */
6542 
6543 /* Python wrapper */
6544 static PyObject *__pyx_pw_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6545 static PyMethodDef __pyx_mdef_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings = {"buildQuadraticCubeLocal2GlobalMappings", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
6546 static PyObject *__pyx_pw_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6547  struct PyMPICommObject *__pyx_v_comm = 0;
6548  int __pyx_v_nSpace;
6549  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
6550  CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
6551  CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
6552  PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned = 0;
6553  CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned = 0;
6554  PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned = 0;
6555  CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
6556  PyArrayObject *__pyx_v_nodeNumbering_subdomain2global = 0;
6557  CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global = 0;
6558  PyArrayObject *__pyx_v_edgeNumbering_subdomain2global = 0;
6559  PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned = 0;
6560  PyArrayObject *__pyx_v_quadratic_subdomain_l2g = 0;
6561  PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global = 0;
6562  PyArrayObject *__pyx_v_quadratic_lagrangeNodes = 0;
6563  int __pyx_lineno = 0;
6564  const char *__pyx_filename = NULL;
6565  int __pyx_clineno = 0;
6566  PyObject *__pyx_r = 0;
6567  __Pyx_RefNannyDeclarations
6568  __Pyx_RefNannySetupContext("buildQuadraticCubeLocal2GlobalMappings (wrapper)", 0);
6569  {
6570  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nSpace,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_nodeOffsets_subdomain_owned,&__pyx_n_s_elementBoundaryOffsets_subdomain,&__pyx_n_s_edgeOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_nodeNumbering_subdomain2global,&__pyx_n_s_elementBoundaryNumbering_subdoma,&__pyx_n_s_edgeNumbering_subdomain2global,&__pyx_n_s_quadratic_dof_offsets_subdomain,&__pyx_n_s_quadratic_subdomain_l2g,&__pyx_n_s_quadraticNumbering_subdomain2glo,&__pyx_n_s_quadratic_lagrangeNodes,0};
6571  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
6572  if (unlikely(__pyx_kwds)) {
6573  Py_ssize_t kw_args;
6574  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6575  switch (pos_args) {
6576  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6577  CYTHON_FALLTHROUGH;
6578  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6579  CYTHON_FALLTHROUGH;
6580  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6581  CYTHON_FALLTHROUGH;
6582  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6583  CYTHON_FALLTHROUGH;
6584  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6585  CYTHON_FALLTHROUGH;
6586  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6587  CYTHON_FALLTHROUGH;
6588  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6589  CYTHON_FALLTHROUGH;
6590  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6591  CYTHON_FALLTHROUGH;
6592  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6593  CYTHON_FALLTHROUGH;
6594  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6595  CYTHON_FALLTHROUGH;
6596  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6597  CYTHON_FALLTHROUGH;
6598  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6599  CYTHON_FALLTHROUGH;
6600  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6601  CYTHON_FALLTHROUGH;
6602  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6603  CYTHON_FALLTHROUGH;
6604  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6605  CYTHON_FALLTHROUGH;
6606  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6607  CYTHON_FALLTHROUGH;
6608  case 0: break;
6609  default: goto __pyx_L5_argtuple_error;
6610  }
6611  kw_args = PyDict_Size(__pyx_kwds);
6612  switch (pos_args) {
6613  case 0:
6614  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
6615  else goto __pyx_L5_argtuple_error;
6616  CYTHON_FALLTHROUGH;
6617  case 1:
6618  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
6619  else {
6620  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 1); __PYX_ERR(0, 171, __pyx_L3_error)
6621  }
6622  CYTHON_FALLTHROUGH;
6623  case 2:
6624  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
6625  else {
6626  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 2); __PYX_ERR(0, 171, __pyx_L3_error)
6627  }
6628  CYTHON_FALLTHROUGH;
6629  case 3:
6630  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
6631  else {
6632  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 3); __PYX_ERR(0, 171, __pyx_L3_error)
6633  }
6634  CYTHON_FALLTHROUGH;
6635  case 4:
6636  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
6637  else {
6638  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 4); __PYX_ERR(0, 171, __pyx_L3_error)
6639  }
6640  CYTHON_FALLTHROUGH;
6641  case 5:
6642  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeOffsets_subdomain_owned)) != 0)) kw_args--;
6643  else {
6644  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 5); __PYX_ERR(0, 171, __pyx_L3_error)
6645  }
6646  CYTHON_FALLTHROUGH;
6647  case 6:
6648  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryOffsets_subdomain)) != 0)) kw_args--;
6649  else {
6650  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 6); __PYX_ERR(0, 171, __pyx_L3_error)
6651  }
6652  CYTHON_FALLTHROUGH;
6653  case 7:
6654  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeOffsets_subdomain_owned)) != 0)) kw_args--;
6655  else {
6656  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 7); __PYX_ERR(0, 171, __pyx_L3_error)
6657  }
6658  CYTHON_FALLTHROUGH;
6659  case 8:
6660  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
6661  else {
6662  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 8); __PYX_ERR(0, 171, __pyx_L3_error)
6663  }
6664  CYTHON_FALLTHROUGH;
6665  case 9:
6666  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeNumbering_subdomain2global)) != 0)) kw_args--;
6667  else {
6668  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 9); __PYX_ERR(0, 171, __pyx_L3_error)
6669  }
6670  CYTHON_FALLTHROUGH;
6671  case 10:
6672  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryNumbering_subdoma)) != 0)) kw_args--;
6673  else {
6674  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 10); __PYX_ERR(0, 171, __pyx_L3_error)
6675  }
6676  CYTHON_FALLTHROUGH;
6677  case 11:
6678  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeNumbering_subdomain2global)) != 0)) kw_args--;
6679  else {
6680  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 11); __PYX_ERR(0, 171, __pyx_L3_error)
6681  }
6682  CYTHON_FALLTHROUGH;
6683  case 12:
6684  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_dof_offsets_subdomain)) != 0)) kw_args--;
6685  else {
6686  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 12); __PYX_ERR(0, 171, __pyx_L3_error)
6687  }
6688  CYTHON_FALLTHROUGH;
6689  case 13:
6690  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_subdomain_l2g)) != 0)) kw_args--;
6691  else {
6692  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 13); __PYX_ERR(0, 171, __pyx_L3_error)
6693  }
6694  CYTHON_FALLTHROUGH;
6695  case 14:
6696  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadraticNumbering_subdomain2glo)) != 0)) kw_args--;
6697  else {
6698  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 14); __PYX_ERR(0, 171, __pyx_L3_error)
6699  }
6700  CYTHON_FALLTHROUGH;
6701  case 15:
6702  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_lagrangeNodes)) != 0)) kw_args--;
6703  else {
6704  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 15); __PYX_ERR(0, 171, __pyx_L3_error)
6705  }
6706  }
6707  if (unlikely(kw_args > 0)) {
6708  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildQuadraticCubeLocal2GlobalMappings") < 0)) __PYX_ERR(0, 171, __pyx_L3_error)
6709  }
6710  } else if (PyTuple_GET_SIZE(__pyx_args) != 16) {
6711  goto __pyx_L5_argtuple_error;
6712  } else {
6713  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6714  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6715  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6716  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6717  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6718  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6719  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6720  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6721  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6722  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6723  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6724  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6725  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6726  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6727  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6728  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6729  }
6730  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
6731  __pyx_v_nSpace = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nSpace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L3_error)
6732  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
6733  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
6734  __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
6735  __pyx_v_nodeOffsets_subdomain_owned = ((PyArrayObject *)values[5]);
6736  __pyx_v_elementBoundaryOffsets_subdomain_owned = ((PyArrayObject *)values[6]);
6737  __pyx_v_edgeOffsets_subdomain_owned = ((PyArrayObject *)values[7]);
6738  __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[8]);
6739  __pyx_v_nodeNumbering_subdomain2global = ((PyArrayObject *)values[9]);
6740  __pyx_v_elementBoundaryNumbering_subdomain2global = ((PyArrayObject *)values[10]);
6741  __pyx_v_edgeNumbering_subdomain2global = ((PyArrayObject *)values[11]);
6742  __pyx_v_quadratic_dof_offsets_subdomain_owned = ((PyArrayObject *)values[12]);
6743  __pyx_v_quadratic_subdomain_l2g = ((PyArrayObject *)values[13]);
6744  __pyx_v_quadraticNumbering_subdomain2global = ((PyArrayObject *)values[14]);
6745  __pyx_v_quadratic_lagrangeNodes = ((PyArrayObject *)values[15]);
6746  }
6747  goto __pyx_L4_argument_unpacking_done;
6748  __pyx_L5_argtuple_error:;
6749  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 171, __pyx_L3_error)
6750  __pyx_L3_error:;
6751  __Pyx_AddTraceback("cpartitioning.buildQuadraticCubeLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6752  __Pyx_RefNannyFinishContext();
6753  return NULL;
6754  __pyx_L4_argument_unpacking_done:;
6755  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 171, __pyx_L1_error)
6756  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 173, __pyx_L1_error)
6757  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 174, __pyx_L1_error)
6758  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 175, __pyx_L1_error)
6759  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "nodeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 176, __pyx_L1_error)
6760  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryOffsets_subdomain_owned", 0))) __PYX_ERR(0, 177, __pyx_L1_error)
6761  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "edgeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 178, __pyx_L1_error)
6762  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 179, __pyx_L1_error)
6763  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "nodeNumbering_subdomain2global", 0))) __PYX_ERR(0, 180, __pyx_L1_error)
6764  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryNumbering_subdomain2global", 0))) __PYX_ERR(0, 181, __pyx_L1_error)
6765  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "edgeNumbering_subdomain2global", 0))) __PYX_ERR(0, 182, __pyx_L1_error)
6766  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_dof_offsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "quadratic_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 183, __pyx_L1_error)
6767  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_subdomain_l2g), __pyx_ptype_5numpy_ndarray, 1, "quadratic_subdomain_l2g", 0))) __PYX_ERR(0, 184, __pyx_L1_error)
6768  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadraticNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "quadraticNumbering_subdomain2global", 0))) __PYX_ERR(0, 185, __pyx_L1_error)
6769  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_lagrangeNodes), __pyx_ptype_5numpy_ndarray, 1, "quadratic_lagrangeNodes", 0))) __PYX_ERR(0, 186, __pyx_L1_error)
6770  __pyx_r = __pyx_pf_13cpartitioning_12buildQuadraticCubeLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nSpace, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_nodeOffsets_subdomain_owned, __pyx_v_elementBoundaryOffsets_subdomain_owned, __pyx_v_edgeOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_edgeNumbering_subdomain2global, __pyx_v_quadratic_dof_offsets_subdomain_owned, __pyx_v_quadratic_subdomain_l2g, __pyx_v_quadraticNumbering_subdomain2global, __pyx_v_quadratic_lagrangeNodes);
6771 
6772  /* function exit code */
6773  goto __pyx_L0;
6774  __pyx_L1_error:;
6775  __pyx_r = NULL;
6776  __pyx_L0:;
6777  __Pyx_RefNannyFinishContext();
6778  return __pyx_r;
6779 }
6780 
6781 static PyObject *__pyx_pf_13cpartitioning_12buildQuadraticCubeLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes) {
6782  int __pyx_v_nDOF_all_processes;
6783  int __pyx_v_nDOF_subdomain;
6784  int __pyx_v_max_dof_neighbors;
6785  PyObject *__pyx_r = NULL;
6786  __Pyx_RefNannyDeclarations
6787  PyObject *__pyx_t_1 = NULL;
6788  PyObject *__pyx_t_2 = NULL;
6789  PyObject *__pyx_t_3 = NULL;
6790  PyObject *__pyx_t_4 = NULL;
6791  int __pyx_lineno = 0;
6792  const char *__pyx_filename = NULL;
6793  int __pyx_clineno = 0;
6794  __Pyx_RefNannySetupContext("buildQuadraticCubeLocal2GlobalMappings", 0);
6795 
6796  /* "cpartitioning.pyx":187
6797  * np.ndarray quadraticNumbering_subdomain2global,
6798  * np.ndarray quadratic_lagrangeNodes):
6799  * cdef int nDOF_all_processes=0 # <<<<<<<<<<<<<<
6800  * cdef int nDOF_subdomain=0
6801  * cdef int max_dof_neighbors=0
6802  */
6803  __pyx_v_nDOF_all_processes = 0;
6804 
6805  /* "cpartitioning.pyx":188
6806  * np.ndarray quadratic_lagrangeNodes):
6807  * cdef int nDOF_all_processes=0
6808  * cdef int nDOF_subdomain=0 # <<<<<<<<<<<<<<
6809  * cdef int max_dof_neighbors=0
6810  * if nSpace == 1:
6811  */
6812  __pyx_v_nDOF_subdomain = 0;
6813 
6814  /* "cpartitioning.pyx":189
6815  * cdef int nDOF_all_processes=0
6816  * cdef int nDOF_subdomain=0
6817  * cdef int max_dof_neighbors=0 # <<<<<<<<<<<<<<
6818  * if nSpace == 1:
6819  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6820  */
6821  __pyx_v_max_dof_neighbors = 0;
6822 
6823  /* "cpartitioning.pyx":190
6824  * cdef int nDOF_subdomain=0
6825  * cdef int max_dof_neighbors=0
6826  * if nSpace == 1: # <<<<<<<<<<<<<<
6827  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6828  * elif nSpace == 2:
6829  */
6830  switch (__pyx_v_nSpace) {
6831  case 1:
6832 
6833  /* "cpartitioning.pyx":191
6834  * cdef int max_dof_neighbors=0
6835  * if nSpace == 1:
6836  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!" # <<<<<<<<<<<<<<
6837  * elif nSpace == 2:
6838  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!"
6839  */
6840  #ifndef CYTHON_WITHOUT_ASSERTIONS
6841  if (unlikely(!Py_OptimizeFlag)) {
6842  if (unlikely(!0)) {
6843  PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_buildQuadraticCubeSubdomain2Glob);
6844  __PYX_ERR(0, 191, __pyx_L1_error)
6845  }
6846  }
6847  #endif
6848 
6849  /* "cpartitioning.pyx":190
6850  * cdef int nDOF_subdomain=0
6851  * cdef int max_dof_neighbors=0
6852  * if nSpace == 1: # <<<<<<<<<<<<<<
6853  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6854  * elif nSpace == 2:
6855  */
6856  break;
6857  case 2:
6858 
6859  /* "cpartitioning.pyx":193
6860  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6861  * elif nSpace == 2:
6862  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!" # <<<<<<<<<<<<<<
6863  * else:
6864  * buildQuadraticCubeSubdomain2GlobalMappings_3d(comm.ob_mpi,
6865  */
6866  #ifndef CYTHON_WITHOUT_ASSERTIONS
6867  if (unlikely(!Py_OptimizeFlag)) {
6868  if (unlikely(!0)) {
6869  PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2);
6870  __PYX_ERR(0, 193, __pyx_L1_error)
6871  }
6872  }
6873  #endif
6874 
6875  /* "cpartitioning.pyx":192
6876  * if nSpace == 1:
6877  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6878  * elif nSpace == 2: # <<<<<<<<<<<<<<
6879  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!"
6880  * else:
6881  */
6882  break;
6883  default:
6884 
6885  /* "cpartitioning.pyx":195
6886  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!"
6887  * else:
6888  * buildQuadraticCubeSubdomain2GlobalMappings_3d(comm.ob_mpi, # <<<<<<<<<<<<<<
6889  * cmesh.mesh,
6890  * <int*>(edgeOffsets_subdomain_owned.data),
6891  */
6892  (void)(proteus::buildQuadraticCubeSubdomain2GlobalMappings_3d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_edgeOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_edgeNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
6893  break;
6894  }
6895 
6896  /* "cpartitioning.pyx":208
6897  * <int*>(quadraticNumbering_subdomain2global.data),
6898  * <double*>(quadratic_lagrangeNodes.data))
6899  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
6900  * nDOF_subdomain,
6901  * max_dof_neighbors)
6902  */
6903  __Pyx_XDECREF(__pyx_r);
6904  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nDOF_all_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
6905  __Pyx_GOTREF(__pyx_t_1);
6906 
6907  /* "cpartitioning.pyx":209
6908  * <double*>(quadratic_lagrangeNodes.data))
6909  * return (nDOF_all_processes,
6910  * nDOF_subdomain, # <<<<<<<<<<<<<<
6911  * max_dof_neighbors)
6912  *
6913  */
6914  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nDOF_subdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
6915  __Pyx_GOTREF(__pyx_t_2);
6916 
6917  /* "cpartitioning.pyx":210
6918  * return (nDOF_all_processes,
6919  * nDOF_subdomain,
6920  * max_dof_neighbors) # <<<<<<<<<<<<<<
6921  *
6922  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm,
6923  */
6924  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_dof_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
6925  __Pyx_GOTREF(__pyx_t_3);
6926 
6927  /* "cpartitioning.pyx":208
6928  * <int*>(quadraticNumbering_subdomain2global.data),
6929  * <double*>(quadratic_lagrangeNodes.data))
6930  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
6931  * nDOF_subdomain,
6932  * max_dof_neighbors)
6933  */
6934  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
6935  __Pyx_GOTREF(__pyx_t_4);
6936  __Pyx_GIVEREF(__pyx_t_1);
6937  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6938  __Pyx_GIVEREF(__pyx_t_2);
6939  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
6940  __Pyx_GIVEREF(__pyx_t_3);
6941  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
6942  __pyx_t_1 = 0;
6943  __pyx_t_2 = 0;
6944  __pyx_t_3 = 0;
6945  __pyx_r = __pyx_t_4;
6946  __pyx_t_4 = 0;
6947  goto __pyx_L0;
6948 
6949  /* "cpartitioning.pyx":171
6950  * max_dof_neighbors)
6951  *
6952  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
6953  * int nSpace,
6954  * cmeshTools.CMesh cmesh,
6955  */
6956 
6957  /* function exit code */
6958  __pyx_L1_error:;
6959  __Pyx_XDECREF(__pyx_t_1);
6960  __Pyx_XDECREF(__pyx_t_2);
6961  __Pyx_XDECREF(__pyx_t_3);
6962  __Pyx_XDECREF(__pyx_t_4);
6963  __Pyx_AddTraceback("cpartitioning.buildQuadraticCubeLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6964  __pyx_r = NULL;
6965  __pyx_L0:;
6966  __Pyx_XGIVEREF(__pyx_r);
6967  __Pyx_RefNannyFinishContext();
6968  return __pyx_r;
6969 }
6970 
6971 /* "cpartitioning.pyx":212
6972  * max_dof_neighbors)
6973  *
6974  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
6975  * int nDOF_element,
6976  * cmeshTools.CMesh cmesh,
6977  */
6978 
6979 /* Python wrapper */
6980 static PyObject *__pyx_pw_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6981 static PyMethodDef __pyx_mdef_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings = {"buildDiscontinuousGalerkinLocal2GlobalMappings", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
6982 static PyObject *__pyx_pw_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6983  struct PyMPICommObject *__pyx_v_comm = 0;
6984  int __pyx_v_nDOF_element;
6985  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
6986  CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
6987  PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
6988  PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
6989  PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned = 0;
6990  PyArrayObject *__pyx_v_dg_subdomain_l2g = 0;
6991  PyArrayObject *__pyx_v_dgNumbering_subdomain2global = 0;
6992  int __pyx_lineno = 0;
6993  const char *__pyx_filename = NULL;
6994  int __pyx_clineno = 0;
6995  PyObject *__pyx_r = 0;
6996  __Pyx_RefNannyDeclarations
6997  __Pyx_RefNannySetupContext("buildDiscontinuousGalerkinLocal2GlobalMappings (wrapper)", 0);
6998  {
6999  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nDOF_element,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_dg_dof_offsets_subdomain_owned,&__pyx_n_s_dg_subdomain_l2g,&__pyx_n_s_dgNumbering_subdomain2global,0};
7000  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
7001  if (unlikely(__pyx_kwds)) {
7002  Py_ssize_t kw_args;
7003  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7004  switch (pos_args) {
7005  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
7006  CYTHON_FALLTHROUGH;
7007  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7008  CYTHON_FALLTHROUGH;
7009  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7010  CYTHON_FALLTHROUGH;
7011  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7012  CYTHON_FALLTHROUGH;
7013  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7014  CYTHON_FALLTHROUGH;
7015  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7016  CYTHON_FALLTHROUGH;
7017  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7018  CYTHON_FALLTHROUGH;
7019  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7020  CYTHON_FALLTHROUGH;
7021  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7022  CYTHON_FALLTHROUGH;
7023  case 0: break;
7024  default: goto __pyx_L5_argtuple_error;
7025  }
7026  kw_args = PyDict_Size(__pyx_kwds);
7027  switch (pos_args) {
7028  case 0:
7029  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
7030  else goto __pyx_L5_argtuple_error;
7031  CYTHON_FALLTHROUGH;
7032  case 1:
7033  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_element)) != 0)) kw_args--;
7034  else {
7035  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 1); __PYX_ERR(0, 212, __pyx_L3_error)
7036  }
7037  CYTHON_FALLTHROUGH;
7038  case 2:
7039  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
7040  else {
7041  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 2); __PYX_ERR(0, 212, __pyx_L3_error)
7042  }
7043  CYTHON_FALLTHROUGH;
7044  case 3:
7045  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
7046  else {
7047  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 3); __PYX_ERR(0, 212, __pyx_L3_error)
7048  }
7049  CYTHON_FALLTHROUGH;
7050  case 4:
7051  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
7052  else {
7053  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 4); __PYX_ERR(0, 212, __pyx_L3_error)
7054  }
7055  CYTHON_FALLTHROUGH;
7056  case 5:
7057  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
7058  else {
7059  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 5); __PYX_ERR(0, 212, __pyx_L3_error)
7060  }
7061  CYTHON_FALLTHROUGH;
7062  case 6:
7063  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dg_dof_offsets_subdomain_owned)) != 0)) kw_args--;
7064  else {
7065  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 6); __PYX_ERR(0, 212, __pyx_L3_error)
7066  }
7067  CYTHON_FALLTHROUGH;
7068  case 7:
7069  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dg_subdomain_l2g)) != 0)) kw_args--;
7070  else {
7071  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 7); __PYX_ERR(0, 212, __pyx_L3_error)
7072  }
7073  CYTHON_FALLTHROUGH;
7074  case 8:
7075  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dgNumbering_subdomain2global)) != 0)) kw_args--;
7076  else {
7077  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 8); __PYX_ERR(0, 212, __pyx_L3_error)
7078  }
7079  }
7080  if (unlikely(kw_args > 0)) {
7081  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildDiscontinuousGalerkinLocal2GlobalMappings") < 0)) __PYX_ERR(0, 212, __pyx_L3_error)
7082  }
7083  } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
7084  goto __pyx_L5_argtuple_error;
7085  } else {
7086  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7087  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7088  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7089  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7090  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7091  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7092  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7093  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7094  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
7095  }
7096  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
7097  __pyx_v_nDOF_element = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nDOF_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L3_error)
7098  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
7099  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
7100  __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
7101  __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[5]);
7102  __pyx_v_dg_dof_offsets_subdomain_owned = ((PyArrayObject *)values[6]);
7103  __pyx_v_dg_subdomain_l2g = ((PyArrayObject *)values[7]);
7104  __pyx_v_dgNumbering_subdomain2global = ((PyArrayObject *)values[8]);
7105  }
7106  goto __pyx_L4_argument_unpacking_done;
7107  __pyx_L5_argtuple_error:;
7108  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 212, __pyx_L3_error)
7109  __pyx_L3_error:;
7110  __Pyx_AddTraceback("cpartitioning.buildDiscontinuousGalerkinLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
7111  __Pyx_RefNannyFinishContext();
7112  return NULL;
7113  __pyx_L4_argument_unpacking_done:;
7114  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 212, __pyx_L1_error)
7115  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 214, __pyx_L1_error)
7116  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 215, __pyx_L1_error)
7117  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 216, __pyx_L1_error)
7118  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 217, __pyx_L1_error)
7119  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dg_dof_offsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "dg_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 218, __pyx_L1_error)
7120  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dg_subdomain_l2g), __pyx_ptype_5numpy_ndarray, 1, "dg_subdomain_l2g", 0))) __PYX_ERR(0, 219, __pyx_L1_error)
7121  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dgNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "dgNumbering_subdomain2global", 0))) __PYX_ERR(0, 220, __pyx_L1_error)
7122  __pyx_r = __pyx_pf_13cpartitioning_14buildDiscontinuousGalerkinLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nDOF_element, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_dg_dof_offsets_subdomain_owned, __pyx_v_dg_subdomain_l2g, __pyx_v_dgNumbering_subdomain2global);
7123 
7124  /* function exit code */
7125  goto __pyx_L0;
7126  __pyx_L1_error:;
7127  __pyx_r = NULL;
7128  __pyx_L0:;
7129  __Pyx_RefNannyFinishContext();
7130  return __pyx_r;
7131 }
7132 
7133 static PyObject *__pyx_pf_13cpartitioning_14buildDiscontinuousGalerkinLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nDOF_element, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_dg_subdomain_l2g, PyArrayObject *__pyx_v_dgNumbering_subdomain2global) {
7134  int __pyx_v_nDOF_all_processes;
7135  int __pyx_v_nDOF_subdomain;
7136  int __pyx_v_max_dof_neighbors;
7137  PyObject *__pyx_r = NULL;
7138  __Pyx_RefNannyDeclarations
7139  PyObject *__pyx_t_1 = NULL;
7140  PyObject *__pyx_t_2 = NULL;
7141  PyObject *__pyx_t_3 = NULL;
7142  PyObject *__pyx_t_4 = NULL;
7143  int __pyx_lineno = 0;
7144  const char *__pyx_filename = NULL;
7145  int __pyx_clineno = 0;
7146  __Pyx_RefNannySetupContext("buildDiscontinuousGalerkinLocal2GlobalMappings", 0);
7147 
7148  /* "cpartitioning.pyx":221
7149  * np.ndarray dg_subdomain_l2g,
7150  * np.ndarray dgNumbering_subdomain2global):
7151  * cdef int nDOF_all_processes=0 # <<<<<<<<<<<<<<
7152  * cdef int nDOF_subdomain=0
7153  * cdef int max_dof_neighbors=0
7154  */
7155  __pyx_v_nDOF_all_processes = 0;
7156 
7157  /* "cpartitioning.pyx":222
7158  * np.ndarray dgNumbering_subdomain2global):
7159  * cdef int nDOF_all_processes=0
7160  * cdef int nDOF_subdomain=0 # <<<<<<<<<<<<<<
7161  * cdef int max_dof_neighbors=0
7162  * buildDiscontinuousGalerkinSubdomain2GlobalMappings(comm.ob_mpi,
7163  */
7164  __pyx_v_nDOF_subdomain = 0;
7165 
7166  /* "cpartitioning.pyx":223
7167  * cdef int nDOF_all_processes=0
7168  * cdef int nDOF_subdomain=0
7169  * cdef int max_dof_neighbors=0 # <<<<<<<<<<<<<<
7170  * buildDiscontinuousGalerkinSubdomain2GlobalMappings(comm.ob_mpi,
7171  * cmesh.mesh,
7172  */
7173  __pyx_v_max_dof_neighbors = 0;
7174 
7175  /* "cpartitioning.pyx":224
7176  * cdef int nDOF_subdomain=0
7177  * cdef int max_dof_neighbors=0
7178  * buildDiscontinuousGalerkinSubdomain2GlobalMappings(comm.ob_mpi, # <<<<<<<<<<<<<<
7179  * cmesh.mesh,
7180  * <int*>(elementOffsets_subdomain_owned.data),
7181  */
7182  (void)(proteus::buildDiscontinuousGalerkinSubdomain2GlobalMappings(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_elementOffsets_subdomain_owned->data), ((int *)__pyx_v_elementNumbering_subdomain2global->data), __pyx_v_nDOF_element, __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_dg_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_dg_subdomain_l2g->data), ((int *)__pyx_v_dgNumbering_subdomain2global->data)));
7183 
7184  /* "cpartitioning.pyx":235
7185  * <int*>(dg_subdomain_l2g.data),
7186  * <int*>(dgNumbering_subdomain2global.data))
7187  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
7188  * nDOF_subdomain,
7189  * max_dof_neighbors)
7190  */
7191  __Pyx_XDECREF(__pyx_r);
7192  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nDOF_all_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
7193  __Pyx_GOTREF(__pyx_t_1);
7194 
7195  /* "cpartitioning.pyx":236
7196  * <int*>(dgNumbering_subdomain2global.data))
7197  * return (nDOF_all_processes,
7198  * nDOF_subdomain, # <<<<<<<<<<<<<<
7199  * max_dof_neighbors)
7200  */
7201  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nDOF_subdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
7202  __Pyx_GOTREF(__pyx_t_2);
7203 
7204  /* "cpartitioning.pyx":237
7205  * return (nDOF_all_processes,
7206  * nDOF_subdomain,
7207  * max_dof_neighbors) # <<<<<<<<<<<<<<
7208  */
7209  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_dof_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error)
7210  __Pyx_GOTREF(__pyx_t_3);
7211 
7212  /* "cpartitioning.pyx":235
7213  * <int*>(dg_subdomain_l2g.data),
7214  * <int*>(dgNumbering_subdomain2global.data))
7215  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
7216  * nDOF_subdomain,
7217  * max_dof_neighbors)
7218  */
7219  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error)
7220  __Pyx_GOTREF(__pyx_t_4);
7221  __Pyx_GIVEREF(__pyx_t_1);
7222  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7223  __Pyx_GIVEREF(__pyx_t_2);
7224  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
7225  __Pyx_GIVEREF(__pyx_t_3);
7226  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
7227  __pyx_t_1 = 0;
7228  __pyx_t_2 = 0;
7229  __pyx_t_3 = 0;
7230  __pyx_r = __pyx_t_4;
7231  __pyx_t_4 = 0;
7232  goto __pyx_L0;
7233 
7234  /* "cpartitioning.pyx":212
7235  * max_dof_neighbors)
7236  *
7237  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
7238  * int nDOF_element,
7239  * cmeshTools.CMesh cmesh,
7240  */
7241 
7242  /* function exit code */
7243  __pyx_L1_error:;
7244  __Pyx_XDECREF(__pyx_t_1);
7245  __Pyx_XDECREF(__pyx_t_2);
7246  __Pyx_XDECREF(__pyx_t_3);
7247  __Pyx_XDECREF(__pyx_t_4);
7248  __Pyx_AddTraceback("cpartitioning.buildDiscontinuousGalerkinLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
7249  __pyx_r = NULL;
7250  __pyx_L0:;
7251  __Pyx_XGIVEREF(__pyx_r);
7252  __Pyx_RefNannyFinishContext();
7253  return __pyx_r;
7254 }
7255 
7256 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":735
7257  * ctypedef npy_cdouble complex_t
7258  *
7259  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7260  * return PyArray_MultiIterNew(1, <void*>a)
7261  *
7262  */
7263 
7264 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
7265  PyObject *__pyx_r = NULL;
7266  __Pyx_RefNannyDeclarations
7267  PyObject *__pyx_t_1 = NULL;
7268  int __pyx_lineno = 0;
7269  const char *__pyx_filename = NULL;
7270  int __pyx_clineno = 0;
7271  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
7272 
7273  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":736
7274  *
7275  * cdef inline object PyArray_MultiIterNew1(a):
7276  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
7277  *
7278  * cdef inline object PyArray_MultiIterNew2(a, b):
7279  */
7280  __Pyx_XDECREF(__pyx_r);
7281  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
7282  __Pyx_GOTREF(__pyx_t_1);
7283  __pyx_r = __pyx_t_1;
7284  __pyx_t_1 = 0;
7285  goto __pyx_L0;
7286 
7287  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":735
7288  * ctypedef npy_cdouble complex_t
7289  *
7290  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7291  * return PyArray_MultiIterNew(1, <void*>a)
7292  *
7293  */
7294 
7295  /* function exit code */
7296  __pyx_L1_error:;
7297  __Pyx_XDECREF(__pyx_t_1);
7298  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7299  __pyx_r = 0;
7300  __pyx_L0:;
7301  __Pyx_XGIVEREF(__pyx_r);
7302  __Pyx_RefNannyFinishContext();
7303  return __pyx_r;
7304 }
7305 
7306 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":738
7307  * return PyArray_MultiIterNew(1, <void*>a)
7308  *
7309  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7310  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7311  *
7312  */
7313 
7314 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
7315  PyObject *__pyx_r = NULL;
7316  __Pyx_RefNannyDeclarations
7317  PyObject *__pyx_t_1 = NULL;
7318  int __pyx_lineno = 0;
7319  const char *__pyx_filename = NULL;
7320  int __pyx_clineno = 0;
7321  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
7322 
7323  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":739
7324  *
7325  * cdef inline object PyArray_MultiIterNew2(a, b):
7326  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
7327  *
7328  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7329  */
7330  __Pyx_XDECREF(__pyx_r);
7331  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 739, __pyx_L1_error)
7332  __Pyx_GOTREF(__pyx_t_1);
7333  __pyx_r = __pyx_t_1;
7334  __pyx_t_1 = 0;
7335  goto __pyx_L0;
7336 
7337  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":738
7338  * return PyArray_MultiIterNew(1, <void*>a)
7339  *
7340  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7341  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7342  *
7343  */
7344 
7345  /* function exit code */
7346  __pyx_L1_error:;
7347  __Pyx_XDECREF(__pyx_t_1);
7348  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7349  __pyx_r = 0;
7350  __pyx_L0:;
7351  __Pyx_XGIVEREF(__pyx_r);
7352  __Pyx_RefNannyFinishContext();
7353  return __pyx_r;
7354 }
7355 
7356 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":741
7357  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7358  *
7359  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7360  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7361  *
7362  */
7363 
7364 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
7365  PyObject *__pyx_r = NULL;
7366  __Pyx_RefNannyDeclarations
7367  PyObject *__pyx_t_1 = NULL;
7368  int __pyx_lineno = 0;
7369  const char *__pyx_filename = NULL;
7370  int __pyx_clineno = 0;
7371  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
7372 
7373  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":742
7374  *
7375  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7376  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
7377  *
7378  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7379  */
7380  __Pyx_XDECREF(__pyx_r);
7381  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 742, __pyx_L1_error)
7382  __Pyx_GOTREF(__pyx_t_1);
7383  __pyx_r = __pyx_t_1;
7384  __pyx_t_1 = 0;
7385  goto __pyx_L0;
7386 
7387  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":741
7388  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7389  *
7390  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7391  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7392  *
7393  */
7394 
7395  /* function exit code */
7396  __pyx_L1_error:;
7397  __Pyx_XDECREF(__pyx_t_1);
7398  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7399  __pyx_r = 0;
7400  __pyx_L0:;
7401  __Pyx_XGIVEREF(__pyx_r);
7402  __Pyx_RefNannyFinishContext();
7403  return __pyx_r;
7404 }
7405 
7406 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":744
7407  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7408  *
7409  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7410  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7411  *
7412  */
7413 
7414 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
7415  PyObject *__pyx_r = NULL;
7416  __Pyx_RefNannyDeclarations
7417  PyObject *__pyx_t_1 = NULL;
7418  int __pyx_lineno = 0;
7419  const char *__pyx_filename = NULL;
7420  int __pyx_clineno = 0;
7421  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
7422 
7423  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":745
7424  *
7425  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7426  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
7427  *
7428  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7429  */
7430  __Pyx_XDECREF(__pyx_r);
7431  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error)
7432  __Pyx_GOTREF(__pyx_t_1);
7433  __pyx_r = __pyx_t_1;
7434  __pyx_t_1 = 0;
7435  goto __pyx_L0;
7436 
7437  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":744
7438  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7439  *
7440  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7441  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7442  *
7443  */
7444 
7445  /* function exit code */
7446  __pyx_L1_error:;
7447  __Pyx_XDECREF(__pyx_t_1);
7448  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7449  __pyx_r = 0;
7450  __pyx_L0:;
7451  __Pyx_XGIVEREF(__pyx_r);
7452  __Pyx_RefNannyFinishContext();
7453  return __pyx_r;
7454 }
7455 
7456 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":747
7457  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7458  *
7459  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7460  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7461  *
7462  */
7463 
7464 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
7465  PyObject *__pyx_r = NULL;
7466  __Pyx_RefNannyDeclarations
7467  PyObject *__pyx_t_1 = NULL;
7468  int __pyx_lineno = 0;
7469  const char *__pyx_filename = NULL;
7470  int __pyx_clineno = 0;
7471  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
7472 
7473  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":748
7474  *
7475  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7476  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
7477  *
7478  * cdef inline tuple PyDataType_SHAPE(dtype d):
7479  */
7480  __Pyx_XDECREF(__pyx_r);
7481  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error)
7482  __Pyx_GOTREF(__pyx_t_1);
7483  __pyx_r = __pyx_t_1;
7484  __pyx_t_1 = 0;
7485  goto __pyx_L0;
7486 
7487  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":747
7488  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7489  *
7490  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7491  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7492  *
7493  */
7494 
7495  /* function exit code */
7496  __pyx_L1_error:;
7497  __Pyx_XDECREF(__pyx_t_1);
7498  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7499  __pyx_r = 0;
7500  __pyx_L0:;
7501  __Pyx_XGIVEREF(__pyx_r);
7502  __Pyx_RefNannyFinishContext();
7503  return __pyx_r;
7504 }
7505 
7506 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":750
7507  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7508  *
7509  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7510  * if PyDataType_HASSUBARRAY(d):
7511  * return <tuple>d.subarray.shape
7512  */
7513 
7514 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7515  PyObject *__pyx_r = NULL;
7516  __Pyx_RefNannyDeclarations
7517  int __pyx_t_1;
7518  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
7519 
7520  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":751
7521  *
7522  * cdef inline tuple PyDataType_SHAPE(dtype d):
7523  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7524  * return <tuple>d.subarray.shape
7525  * else:
7526  */
7527  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7528  if (__pyx_t_1) {
7529 
7530  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":752
7531  * cdef inline tuple PyDataType_SHAPE(dtype d):
7532  * if PyDataType_HASSUBARRAY(d):
7533  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
7534  * else:
7535  * return ()
7536  */
7537  __Pyx_XDECREF(__pyx_r);
7538  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7539  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7540  goto __pyx_L0;
7541 
7542  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":751
7543  *
7544  * cdef inline tuple PyDataType_SHAPE(dtype d):
7545  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7546  * return <tuple>d.subarray.shape
7547  * else:
7548  */
7549  }
7550 
7551  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":754
7552  * return <tuple>d.subarray.shape
7553  * else:
7554  * return () # <<<<<<<<<<<<<<
7555  *
7556  *
7557  */
7558  /*else*/ {
7559  __Pyx_XDECREF(__pyx_r);
7560  __Pyx_INCREF(__pyx_empty_tuple);
7561  __pyx_r = __pyx_empty_tuple;
7562  goto __pyx_L0;
7563  }
7564 
7565  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":750
7566  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7567  *
7568  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7569  * if PyDataType_HASSUBARRAY(d):
7570  * return <tuple>d.subarray.shape
7571  */
7572 
7573  /* function exit code */
7574  __pyx_L0:;
7575  __Pyx_XGIVEREF(__pyx_r);
7576  __Pyx_RefNannyFinishContext();
7577  return __pyx_r;
7578 }
7579 
7580 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":929
7581  * int _import_umath() except -1
7582  *
7583  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7584  * Py_INCREF(base) # important to do this before stealing the reference below!
7585  * PyArray_SetBaseObject(arr, base)
7586  */
7587 
7588 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7589  __Pyx_RefNannyDeclarations
7590  __Pyx_RefNannySetupContext("set_array_base", 0);
7591 
7592  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":930
7593  *
7594  * cdef inline void set_array_base(ndarray arr, object base):
7595  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
7596  * PyArray_SetBaseObject(arr, base)
7597  *
7598  */
7599  Py_INCREF(__pyx_v_base);
7600 
7601  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":931
7602  * cdef inline void set_array_base(ndarray arr, object base):
7603  * Py_INCREF(base) # important to do this before stealing the reference below!
7604  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
7605  *
7606  * cdef inline object get_array_base(ndarray arr):
7607  */
7608  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
7609 
7610  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":929
7611  * int _import_umath() except -1
7612  *
7613  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7614  * Py_INCREF(base) # important to do this before stealing the reference below!
7615  * PyArray_SetBaseObject(arr, base)
7616  */
7617 
7618  /* function exit code */
7619  __Pyx_RefNannyFinishContext();
7620 }
7621 
7622 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":933
7623  * PyArray_SetBaseObject(arr, base)
7624  *
7625  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7626  * base = PyArray_BASE(arr)
7627  * if base is NULL:
7628  */
7629 
7630 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7631  PyObject *__pyx_v_base;
7632  PyObject *__pyx_r = NULL;
7633  __Pyx_RefNannyDeclarations
7634  int __pyx_t_1;
7635  __Pyx_RefNannySetupContext("get_array_base", 0);
7636 
7637  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":934
7638  *
7639  * cdef inline object get_array_base(ndarray arr):
7640  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
7641  * if base is NULL:
7642  * return None
7643  */
7644  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
7645 
7646  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":935
7647  * cdef inline object get_array_base(ndarray arr):
7648  * base = PyArray_BASE(arr)
7649  * if base is NULL: # <<<<<<<<<<<<<<
7650  * return None
7651  * return <object>base
7652  */
7653  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
7654  if (__pyx_t_1) {
7655 
7656  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":936
7657  * base = PyArray_BASE(arr)
7658  * if base is NULL:
7659  * return None # <<<<<<<<<<<<<<
7660  * return <object>base
7661  *
7662  */
7663  __Pyx_XDECREF(__pyx_r);
7664  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7665  goto __pyx_L0;
7666 
7667  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":935
7668  * cdef inline object get_array_base(ndarray arr):
7669  * base = PyArray_BASE(arr)
7670  * if base is NULL: # <<<<<<<<<<<<<<
7671  * return None
7672  * return <object>base
7673  */
7674  }
7675 
7676  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":937
7677  * if base is NULL:
7678  * return None
7679  * return <object>base # <<<<<<<<<<<<<<
7680  *
7681  * # Versions of the import_* functions which are more suitable for
7682  */
7683  __Pyx_XDECREF(__pyx_r);
7684  __Pyx_INCREF(((PyObject *)__pyx_v_base));
7685  __pyx_r = ((PyObject *)__pyx_v_base);
7686  goto __pyx_L0;
7687 
7688  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":933
7689  * PyArray_SetBaseObject(arr, base)
7690  *
7691  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7692  * base = PyArray_BASE(arr)
7693  * if base is NULL:
7694  */
7695 
7696  /* function exit code */
7697  __pyx_L0:;
7698  __Pyx_XGIVEREF(__pyx_r);
7699  __Pyx_RefNannyFinishContext();
7700  return __pyx_r;
7701 }
7702 
7703 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":941
7704  * # Versions of the import_* functions which are more suitable for
7705  * # Cython code.
7706  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7707  * try:
7708  * __pyx_import_array()
7709  */
7710 
7711 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
7712  int __pyx_r;
7713  __Pyx_RefNannyDeclarations
7714  PyObject *__pyx_t_1 = NULL;
7715  PyObject *__pyx_t_2 = NULL;
7716  PyObject *__pyx_t_3 = NULL;
7717  int __pyx_t_4;
7718  PyObject *__pyx_t_5 = NULL;
7719  PyObject *__pyx_t_6 = NULL;
7720  PyObject *__pyx_t_7 = NULL;
7721  PyObject *__pyx_t_8 = NULL;
7722  int __pyx_lineno = 0;
7723  const char *__pyx_filename = NULL;
7724  int __pyx_clineno = 0;
7725  __Pyx_RefNannySetupContext("import_array", 0);
7726 
7727  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942
7728  * # Cython code.
7729  * cdef inline int import_array() except -1:
7730  * try: # <<<<<<<<<<<<<<
7731  * __pyx_import_array()
7732  * except Exception:
7733  */
7734  {
7735  __Pyx_PyThreadState_declare
7736  __Pyx_PyThreadState_assign
7737  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7738  __Pyx_XGOTREF(__pyx_t_1);
7739  __Pyx_XGOTREF(__pyx_t_2);
7740  __Pyx_XGOTREF(__pyx_t_3);
7741  /*try:*/ {
7742 
7743  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":943
7744  * cdef inline int import_array() except -1:
7745  * try:
7746  * __pyx_import_array() # <<<<<<<<<<<<<<
7747  * except Exception:
7748  * raise ImportError("numpy.core.multiarray failed to import")
7749  */
7750  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L3_error)
7751 
7752  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942
7753  * # Cython code.
7754  * cdef inline int import_array() except -1:
7755  * try: # <<<<<<<<<<<<<<
7756  * __pyx_import_array()
7757  * except Exception:
7758  */
7759  }
7760  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7761  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7762  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7763  goto __pyx_L8_try_end;
7764  __pyx_L3_error:;
7765 
7766  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":944
7767  * try:
7768  * __pyx_import_array()
7769  * except Exception: # <<<<<<<<<<<<<<
7770  * raise ImportError("numpy.core.multiarray failed to import")
7771  *
7772  */
7773  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7774  if (__pyx_t_4) {
7775  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7776  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 944, __pyx_L5_except_error)
7777  __Pyx_GOTREF(__pyx_t_5);
7778  __Pyx_GOTREF(__pyx_t_6);
7779  __Pyx_GOTREF(__pyx_t_7);
7780 
7781  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":945
7782  * __pyx_import_array()
7783  * except Exception:
7784  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
7785  *
7786  * cdef inline int import_umath() except -1:
7787  */
7788  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 945, __pyx_L5_except_error)
7789  __Pyx_GOTREF(__pyx_t_8);
7790  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7791  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7792  __PYX_ERR(1, 945, __pyx_L5_except_error)
7793  }
7794  goto __pyx_L5_except_error;
7795  __pyx_L5_except_error:;
7796 
7797  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942
7798  * # Cython code.
7799  * cdef inline int import_array() except -1:
7800  * try: # <<<<<<<<<<<<<<
7801  * __pyx_import_array()
7802  * except Exception:
7803  */
7804  __Pyx_XGIVEREF(__pyx_t_1);
7805  __Pyx_XGIVEREF(__pyx_t_2);
7806  __Pyx_XGIVEREF(__pyx_t_3);
7807  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7808  goto __pyx_L1_error;
7809  __pyx_L8_try_end:;
7810  }
7811 
7812  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":941
7813  * # Versions of the import_* functions which are more suitable for
7814  * # Cython code.
7815  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7816  * try:
7817  * __pyx_import_array()
7818  */
7819 
7820  /* function exit code */
7821  __pyx_r = 0;
7822  goto __pyx_L0;
7823  __pyx_L1_error:;
7824  __Pyx_XDECREF(__pyx_t_5);
7825  __Pyx_XDECREF(__pyx_t_6);
7826  __Pyx_XDECREF(__pyx_t_7);
7827  __Pyx_XDECREF(__pyx_t_8);
7828  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7829  __pyx_r = -1;
7830  __pyx_L0:;
7831  __Pyx_RefNannyFinishContext();
7832  return __pyx_r;
7833 }
7834 
7835 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":947
7836  * raise ImportError("numpy.core.multiarray failed to import")
7837  *
7838  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7839  * try:
7840  * _import_umath()
7841  */
7842 
7843 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
7844  int __pyx_r;
7845  __Pyx_RefNannyDeclarations
7846  PyObject *__pyx_t_1 = NULL;
7847  PyObject *__pyx_t_2 = NULL;
7848  PyObject *__pyx_t_3 = NULL;
7849  int __pyx_t_4;
7850  PyObject *__pyx_t_5 = NULL;
7851  PyObject *__pyx_t_6 = NULL;
7852  PyObject *__pyx_t_7 = NULL;
7853  PyObject *__pyx_t_8 = NULL;
7854  int __pyx_lineno = 0;
7855  const char *__pyx_filename = NULL;
7856  int __pyx_clineno = 0;
7857  __Pyx_RefNannySetupContext("import_umath", 0);
7858 
7859  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948
7860  *
7861  * cdef inline int import_umath() except -1:
7862  * try: # <<<<<<<<<<<<<<
7863  * _import_umath()
7864  * except Exception:
7865  */
7866  {
7867  __Pyx_PyThreadState_declare
7868  __Pyx_PyThreadState_assign
7869  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7870  __Pyx_XGOTREF(__pyx_t_1);
7871  __Pyx_XGOTREF(__pyx_t_2);
7872  __Pyx_XGOTREF(__pyx_t_3);
7873  /*try:*/ {
7874 
7875  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":949
7876  * cdef inline int import_umath() except -1:
7877  * try:
7878  * _import_umath() # <<<<<<<<<<<<<<
7879  * except Exception:
7880  * raise ImportError("numpy.core.umath failed to import")
7881  */
7882  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 949, __pyx_L3_error)
7883 
7884  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948
7885  *
7886  * cdef inline int import_umath() except -1:
7887  * try: # <<<<<<<<<<<<<<
7888  * _import_umath()
7889  * except Exception:
7890  */
7891  }
7892  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7893  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7894  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7895  goto __pyx_L8_try_end;
7896  __pyx_L3_error:;
7897 
7898  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":950
7899  * try:
7900  * _import_umath()
7901  * except Exception: # <<<<<<<<<<<<<<
7902  * raise ImportError("numpy.core.umath failed to import")
7903  *
7904  */
7905  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7906  if (__pyx_t_4) {
7907  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7908  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 950, __pyx_L5_except_error)
7909  __Pyx_GOTREF(__pyx_t_5);
7910  __Pyx_GOTREF(__pyx_t_6);
7911  __Pyx_GOTREF(__pyx_t_7);
7912 
7913  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":951
7914  * _import_umath()
7915  * except Exception:
7916  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7917  *
7918  * cdef inline int import_ufunc() except -1:
7919  */
7920  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 951, __pyx_L5_except_error)
7921  __Pyx_GOTREF(__pyx_t_8);
7922  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7923  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7924  __PYX_ERR(1, 951, __pyx_L5_except_error)
7925  }
7926  goto __pyx_L5_except_error;
7927  __pyx_L5_except_error:;
7928 
7929  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948
7930  *
7931  * cdef inline int import_umath() except -1:
7932  * try: # <<<<<<<<<<<<<<
7933  * _import_umath()
7934  * except Exception:
7935  */
7936  __Pyx_XGIVEREF(__pyx_t_1);
7937  __Pyx_XGIVEREF(__pyx_t_2);
7938  __Pyx_XGIVEREF(__pyx_t_3);
7939  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7940  goto __pyx_L1_error;
7941  __pyx_L8_try_end:;
7942  }
7943 
7944  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":947
7945  * raise ImportError("numpy.core.multiarray failed to import")
7946  *
7947  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7948  * try:
7949  * _import_umath()
7950  */
7951 
7952  /* function exit code */
7953  __pyx_r = 0;
7954  goto __pyx_L0;
7955  __pyx_L1_error:;
7956  __Pyx_XDECREF(__pyx_t_5);
7957  __Pyx_XDECREF(__pyx_t_6);
7958  __Pyx_XDECREF(__pyx_t_7);
7959  __Pyx_XDECREF(__pyx_t_8);
7960  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7961  __pyx_r = -1;
7962  __pyx_L0:;
7963  __Pyx_RefNannyFinishContext();
7964  return __pyx_r;
7965 }
7966 
7967 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":953
7968  * raise ImportError("numpy.core.umath failed to import")
7969  *
7970  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
7971  * try:
7972  * _import_umath()
7973  */
7974 
7975 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
7976  int __pyx_r;
7977  __Pyx_RefNannyDeclarations
7978  PyObject *__pyx_t_1 = NULL;
7979  PyObject *__pyx_t_2 = NULL;
7980  PyObject *__pyx_t_3 = NULL;
7981  int __pyx_t_4;
7982  PyObject *__pyx_t_5 = NULL;
7983  PyObject *__pyx_t_6 = NULL;
7984  PyObject *__pyx_t_7 = NULL;
7985  PyObject *__pyx_t_8 = NULL;
7986  int __pyx_lineno = 0;
7987  const char *__pyx_filename = NULL;
7988  int __pyx_clineno = 0;
7989  __Pyx_RefNannySetupContext("import_ufunc", 0);
7990 
7991  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954
7992  *
7993  * cdef inline int import_ufunc() except -1:
7994  * try: # <<<<<<<<<<<<<<
7995  * _import_umath()
7996  * except Exception:
7997  */
7998  {
7999  __Pyx_PyThreadState_declare
8000  __Pyx_PyThreadState_assign
8001  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8002  __Pyx_XGOTREF(__pyx_t_1);
8003  __Pyx_XGOTREF(__pyx_t_2);
8004  __Pyx_XGOTREF(__pyx_t_3);
8005  /*try:*/ {
8006 
8007  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":955
8008  * cdef inline int import_ufunc() except -1:
8009  * try:
8010  * _import_umath() # <<<<<<<<<<<<<<
8011  * except Exception:
8012  * raise ImportError("numpy.core.umath failed to import")
8013  */
8014  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 955, __pyx_L3_error)
8015 
8016  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954
8017  *
8018  * cdef inline int import_ufunc() except -1:
8019  * try: # <<<<<<<<<<<<<<
8020  * _import_umath()
8021  * except Exception:
8022  */
8023  }
8024  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8025  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8026  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8027  goto __pyx_L8_try_end;
8028  __pyx_L3_error:;
8029 
8030  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":956
8031  * try:
8032  * _import_umath()
8033  * except Exception: # <<<<<<<<<<<<<<
8034  * raise ImportError("numpy.core.umath failed to import")
8035  *
8036  */
8037  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8038  if (__pyx_t_4) {
8039  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8040  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 956, __pyx_L5_except_error)
8041  __Pyx_GOTREF(__pyx_t_5);
8042  __Pyx_GOTREF(__pyx_t_6);
8043  __Pyx_GOTREF(__pyx_t_7);
8044 
8045  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":957
8046  * _import_umath()
8047  * except Exception:
8048  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8049  *
8050  * cdef extern from *:
8051  */
8052  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 957, __pyx_L5_except_error)
8053  __Pyx_GOTREF(__pyx_t_8);
8054  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8055  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8056  __PYX_ERR(1, 957, __pyx_L5_except_error)
8057  }
8058  goto __pyx_L5_except_error;
8059  __pyx_L5_except_error:;
8060 
8061  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954
8062  *
8063  * cdef inline int import_ufunc() except -1:
8064  * try: # <<<<<<<<<<<<<<
8065  * _import_umath()
8066  * except Exception:
8067  */
8068  __Pyx_XGIVEREF(__pyx_t_1);
8069  __Pyx_XGIVEREF(__pyx_t_2);
8070  __Pyx_XGIVEREF(__pyx_t_3);
8071  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8072  goto __pyx_L1_error;
8073  __pyx_L8_try_end:;
8074  }
8075 
8076  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":953
8077  * raise ImportError("numpy.core.umath failed to import")
8078  *
8079  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8080  * try:
8081  * _import_umath()
8082  */
8083 
8084  /* function exit code */
8085  __pyx_r = 0;
8086  goto __pyx_L0;
8087  __pyx_L1_error:;
8088  __Pyx_XDECREF(__pyx_t_5);
8089  __Pyx_XDECREF(__pyx_t_6);
8090  __Pyx_XDECREF(__pyx_t_7);
8091  __Pyx_XDECREF(__pyx_t_8);
8092  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8093  __pyx_r = -1;
8094  __pyx_L0:;
8095  __Pyx_RefNannyFinishContext();
8096  return __pyx_r;
8097 }
8098 
8099 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":967
8100  *
8101  *
8102  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
8103  * """
8104  * Cython equivalent of `isinstance(obj, np.timedelta64)`
8105  */
8106 
8107 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
8108  int __pyx_r;
8109  __Pyx_RefNannyDeclarations
8110  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
8111 
8112  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":979
8113  * bool
8114  * """
8115  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
8116  *
8117  *
8118  */
8119  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
8120  goto __pyx_L0;
8121 
8122  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":967
8123  *
8124  *
8125  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
8126  * """
8127  * Cython equivalent of `isinstance(obj, np.timedelta64)`
8128  */
8129 
8130  /* function exit code */
8131  __pyx_L0:;
8132  __Pyx_RefNannyFinishContext();
8133  return __pyx_r;
8134 }
8135 
8136 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":982
8137  *
8138  *
8139  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
8140  * """
8141  * Cython equivalent of `isinstance(obj, np.datetime64)`
8142  */
8143 
8144 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
8145  int __pyx_r;
8146  __Pyx_RefNannyDeclarations
8147  __Pyx_RefNannySetupContext("is_datetime64_object", 0);
8148 
8149  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":994
8150  * bool
8151  * """
8152  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
8153  *
8154  *
8155  */
8156  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
8157  goto __pyx_L0;
8158 
8159  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":982
8160  *
8161  *
8162  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
8163  * """
8164  * Cython equivalent of `isinstance(obj, np.datetime64)`
8165  */
8166 
8167  /* function exit code */
8168  __pyx_L0:;
8169  __Pyx_RefNannyFinishContext();
8170  return __pyx_r;
8171 }
8172 
8173 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":997
8174  *
8175  *
8176  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
8177  * """
8178  * returns the int64 value underlying scalar numpy datetime64 object
8179  */
8180 
8181 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
8182  npy_datetime __pyx_r;
8183 
8184  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1004
8185  * also needed. That can be found using `get_datetime64_unit`.
8186  * """
8187  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
8188  *
8189  *
8190  */
8191  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
8192  goto __pyx_L0;
8193 
8194  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":997
8195  *
8196  *
8197  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
8198  * """
8199  * returns the int64 value underlying scalar numpy datetime64 object
8200  */
8201 
8202  /* function exit code */
8203  __pyx_L0:;
8204  return __pyx_r;
8205 }
8206 
8207 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1007
8208  *
8209  *
8210  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
8211  * """
8212  * returns the int64 value underlying scalar numpy timedelta64 object
8213  */
8214 
8215 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
8216  npy_timedelta __pyx_r;
8217 
8218  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1011
8219  * returns the int64 value underlying scalar numpy timedelta64 object
8220  * """
8221  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
8222  *
8223  *
8224  */
8225  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
8226  goto __pyx_L0;
8227 
8228  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1007
8229  *
8230  *
8231  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
8232  * """
8233  * returns the int64 value underlying scalar numpy timedelta64 object
8234  */
8235 
8236  /* function exit code */
8237  __pyx_L0:;
8238  return __pyx_r;
8239 }
8240 
8241 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1014
8242  *
8243  *
8244  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
8245  * """
8246  * returns the unit part of the dtype for a numpy datetime64 object.
8247  */
8248 
8249 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
8250  NPY_DATETIMEUNIT __pyx_r;
8251 
8252  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1018
8253  * returns the unit part of the dtype for a numpy datetime64 object.
8254  * """
8255  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
8256  */
8257  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
8258  goto __pyx_L0;
8259 
8260  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1014
8261  *
8262  *
8263  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
8264  * """
8265  * returns the unit part of the dtype for a numpy datetime64 object.
8266  */
8267 
8268  /* function exit code */
8269  __pyx_L0:;
8270  return __pyx_r;
8271 }
8272 
8273 /* "View.MemoryView":122
8274  * cdef bint dtype_is_object
8275  *
8276  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8277  * mode="c", bint allocate_buffer=True):
8278  *
8279  */
8280 
8281 /* Python wrapper */
8282 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8283 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8284  PyObject *__pyx_v_shape = 0;
8285  Py_ssize_t __pyx_v_itemsize;
8286  PyObject *__pyx_v_format = 0;
8287  PyObject *__pyx_v_mode = 0;
8288  int __pyx_v_allocate_buffer;
8289  int __pyx_lineno = 0;
8290  const char *__pyx_filename = NULL;
8291  int __pyx_clineno = 0;
8292  int __pyx_r;
8293  __Pyx_RefNannyDeclarations
8294  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8295  {
8296  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
8297  PyObject* values[5] = {0,0,0,0,0};
8298  values[3] = ((PyObject *)__pyx_n_s_c);
8299  if (unlikely(__pyx_kwds)) {
8300  Py_ssize_t kw_args;
8301  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8302  switch (pos_args) {
8303  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8304  CYTHON_FALLTHROUGH;
8305  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8306  CYTHON_FALLTHROUGH;
8307  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8308  CYTHON_FALLTHROUGH;
8309  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8310  CYTHON_FALLTHROUGH;
8311  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8312  CYTHON_FALLTHROUGH;
8313  case 0: break;
8314  default: goto __pyx_L5_argtuple_error;
8315  }
8316  kw_args = PyDict_Size(__pyx_kwds);
8317  switch (pos_args) {
8318  case 0:
8319  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
8320  else goto __pyx_L5_argtuple_error;
8321  CYTHON_FALLTHROUGH;
8322  case 1:
8323  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
8324  else {
8325  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 122, __pyx_L3_error)
8326  }
8327  CYTHON_FALLTHROUGH;
8328  case 2:
8329  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
8330  else {
8331  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 122, __pyx_L3_error)
8332  }
8333  CYTHON_FALLTHROUGH;
8334  case 3:
8335  if (kw_args > 0) {
8336  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
8337  if (value) { values[3] = value; kw_args--; }
8338  }
8339  CYTHON_FALLTHROUGH;
8340  case 4:
8341  if (kw_args > 0) {
8342  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
8343  if (value) { values[4] = value; kw_args--; }
8344  }
8345  }
8346  if (unlikely(kw_args > 0)) {
8347  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 122, __pyx_L3_error)
8348  }
8349  } else {
8350  switch (PyTuple_GET_SIZE(__pyx_args)) {
8351  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8352  CYTHON_FALLTHROUGH;
8353  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8354  CYTHON_FALLTHROUGH;
8355  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8356  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8357  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8358  break;
8359  default: goto __pyx_L5_argtuple_error;
8360  }
8361  }
8362  __pyx_v_shape = ((PyObject*)values[0]);
8363  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 122, __pyx_L3_error)
8364  __pyx_v_format = values[2];
8365  __pyx_v_mode = values[3];
8366  if (values[4]) {
8367  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error)
8368  } else {
8369 
8370  /* "View.MemoryView":123
8371  *
8372  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
8373  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
8374  *
8375  * cdef int idx
8376  */
8377  __pyx_v_allocate_buffer = ((int)1);
8378  }
8379  }
8380  goto __pyx_L4_argument_unpacking_done;
8381  __pyx_L5_argtuple_error:;
8382  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 122, __pyx_L3_error)
8383  __pyx_L3_error:;
8384  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8385  __Pyx_RefNannyFinishContext();
8386  return -1;
8387  __pyx_L4_argument_unpacking_done:;
8388  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 122, __pyx_L1_error)
8389  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
8390  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 122, __pyx_L1_error)
8391  }
8392  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
8393 
8394  /* "View.MemoryView":122
8395  * cdef bint dtype_is_object
8396  *
8397  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8398  * mode="c", bint allocate_buffer=True):
8399  *
8400  */
8401 
8402  /* function exit code */
8403  goto __pyx_L0;
8404  __pyx_L1_error:;
8405  __pyx_r = -1;
8406  __pyx_L0:;
8407  __Pyx_RefNannyFinishContext();
8408  return __pyx_r;
8409 }
8410 
8411 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
8412  int __pyx_v_idx;
8413  Py_ssize_t __pyx_v_i;
8414  Py_ssize_t __pyx_v_dim;
8415  PyObject **__pyx_v_p;
8416  char __pyx_v_order;
8417  int __pyx_r;
8418  __Pyx_RefNannyDeclarations
8419  Py_ssize_t __pyx_t_1;
8420  int __pyx_t_2;
8421  PyObject *__pyx_t_3 = NULL;
8422  int __pyx_t_4;
8423  PyObject *__pyx_t_5 = NULL;
8424  PyObject *__pyx_t_6 = NULL;
8425  char *__pyx_t_7;
8426  int __pyx_t_8;
8427  Py_ssize_t __pyx_t_9;
8428  PyObject *__pyx_t_10 = NULL;
8429  Py_ssize_t __pyx_t_11;
8430  int __pyx_lineno = 0;
8431  const char *__pyx_filename = NULL;
8432  int __pyx_clineno = 0;
8433  __Pyx_RefNannySetupContext("__cinit__", 0);
8434  __Pyx_INCREF(__pyx_v_format);
8435 
8436  /* "View.MemoryView":129
8437  * cdef PyObject **p
8438  *
8439  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
8440  * self.itemsize = itemsize
8441  *
8442  */
8443  if (unlikely(__pyx_v_shape == Py_None)) {
8444  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
8445  __PYX_ERR(2, 129, __pyx_L1_error)
8446  }
8447  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 129, __pyx_L1_error)
8448  __pyx_v_self->ndim = ((int)__pyx_t_1);
8449 
8450  /* "View.MemoryView":130
8451  *
8452  * self.ndim = <int> len(shape)
8453  * self.itemsize = itemsize # <<<<<<<<<<<<<<
8454  *
8455  * if not self.ndim:
8456  */
8457  __pyx_v_self->itemsize = __pyx_v_itemsize;
8458 
8459  /* "View.MemoryView":132
8460  * self.itemsize = itemsize
8461  *
8462  * if not self.ndim: # <<<<<<<<<<<<<<
8463  * raise ValueError("Empty shape tuple for cython.array")
8464  *
8465  */
8466  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
8467  if (unlikely(__pyx_t_2)) {
8468 
8469  /* "View.MemoryView":133
8470  *
8471  * if not self.ndim:
8472  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
8473  *
8474  * if itemsize <= 0:
8475  */
8476  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 133, __pyx_L1_error)
8477  __Pyx_GOTREF(__pyx_t_3);
8478  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8479  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8480  __PYX_ERR(2, 133, __pyx_L1_error)
8481 
8482  /* "View.MemoryView":132
8483  * self.itemsize = itemsize
8484  *
8485  * if not self.ndim: # <<<<<<<<<<<<<<
8486  * raise ValueError("Empty shape tuple for cython.array")
8487  *
8488  */
8489  }
8490 
8491  /* "View.MemoryView":135
8492  * raise ValueError("Empty shape tuple for cython.array")
8493  *
8494  * if itemsize <= 0: # <<<<<<<<<<<<<<
8495  * raise ValueError("itemsize <= 0 for cython.array")
8496  *
8497  */
8498  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8499  if (unlikely(__pyx_t_2)) {
8500 
8501  /* "View.MemoryView":136
8502  *
8503  * if itemsize <= 0:
8504  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
8505  *
8506  * if not isinstance(format, bytes):
8507  */
8508  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 136, __pyx_L1_error)
8509  __Pyx_GOTREF(__pyx_t_3);
8510  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8511  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8512  __PYX_ERR(2, 136, __pyx_L1_error)
8513 
8514  /* "View.MemoryView":135
8515  * raise ValueError("Empty shape tuple for cython.array")
8516  *
8517  * if itemsize <= 0: # <<<<<<<<<<<<<<
8518  * raise ValueError("itemsize <= 0 for cython.array")
8519  *
8520  */
8521  }
8522 
8523  /* "View.MemoryView":138
8524  * raise ValueError("itemsize <= 0 for cython.array")
8525  *
8526  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8527  * format = format.encode('ASCII')
8528  * self._format = format # keep a reference to the byte string
8529  */
8530  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8531  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8532  if (__pyx_t_4) {
8533 
8534  /* "View.MemoryView":139
8535  *
8536  * if not isinstance(format, bytes):
8537  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
8538  * self._format = format # keep a reference to the byte string
8539  * self.format = self._format
8540  */
8541  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 139, __pyx_L1_error)
8542  __Pyx_GOTREF(__pyx_t_5);
8543  __pyx_t_6 = NULL;
8544  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8545  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8546  if (likely(__pyx_t_6)) {
8547  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8548  __Pyx_INCREF(__pyx_t_6);
8549  __Pyx_INCREF(function);
8550  __Pyx_DECREF_SET(__pyx_t_5, function);
8551  }
8552  }
8553  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
8554  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8555  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 139, __pyx_L1_error)
8556  __Pyx_GOTREF(__pyx_t_3);
8557  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8558  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
8559  __pyx_t_3 = 0;
8560 
8561  /* "View.MemoryView":138
8562  * raise ValueError("itemsize <= 0 for cython.array")
8563  *
8564  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8565  * format = format.encode('ASCII')
8566  * self._format = format # keep a reference to the byte string
8567  */
8568  }
8569 
8570  /* "View.MemoryView":140
8571  * if not isinstance(format, bytes):
8572  * format = format.encode('ASCII')
8573  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
8574  * self.format = self._format
8575  *
8576  */
8577  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 140, __pyx_L1_error)
8578  __pyx_t_3 = __pyx_v_format;
8579  __Pyx_INCREF(__pyx_t_3);
8580  __Pyx_GIVEREF(__pyx_t_3);
8581  __Pyx_GOTREF(__pyx_v_self->_format);
8582  __Pyx_DECREF(__pyx_v_self->_format);
8583  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
8584  __pyx_t_3 = 0;
8585 
8586  /* "View.MemoryView":141
8587  * format = format.encode('ASCII')
8588  * self._format = format # keep a reference to the byte string
8589  * self.format = self._format # <<<<<<<<<<<<<<
8590  *
8591  *
8592  */
8593  if (unlikely(__pyx_v_self->_format == Py_None)) {
8594  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
8595  __PYX_ERR(2, 141, __pyx_L1_error)
8596  }
8597  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 141, __pyx_L1_error)
8598  __pyx_v_self->format = __pyx_t_7;
8599 
8600  /* "View.MemoryView":144
8601  *
8602  *
8603  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
8604  * self._strides = self._shape + self.ndim
8605  *
8606  */
8607  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8608 
8609  /* "View.MemoryView":145
8610  *
8611  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
8612  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
8613  *
8614  * if not self._shape:
8615  */
8616  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8617 
8618  /* "View.MemoryView":147
8619  * self._strides = self._shape + self.ndim
8620  *
8621  * if not self._shape: # <<<<<<<<<<<<<<
8622  * raise MemoryError("unable to allocate shape and strides.")
8623  *
8624  */
8625  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8626  if (unlikely(__pyx_t_4)) {
8627 
8628  /* "View.MemoryView":148
8629  *
8630  * if not self._shape:
8631  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
8632  *
8633  *
8634  */
8635  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __pyx_L1_error)
8636  __Pyx_GOTREF(__pyx_t_3);
8637  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8638  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8639  __PYX_ERR(2, 148, __pyx_L1_error)
8640 
8641  /* "View.MemoryView":147
8642  * self._strides = self._shape + self.ndim
8643  *
8644  * if not self._shape: # <<<<<<<<<<<<<<
8645  * raise MemoryError("unable to allocate shape and strides.")
8646  *
8647  */
8648  }
8649 
8650  /* "View.MemoryView":151
8651  *
8652  *
8653  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8654  * if dim <= 0:
8655  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8656  */
8657  __pyx_t_8 = 0;
8658  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
8659  for (;;) {
8660  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
8661  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8662  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 151, __pyx_L1_error)
8663  #else
8664  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 151, __pyx_L1_error)
8665  __Pyx_GOTREF(__pyx_t_5);
8666  #endif
8667  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 151, __pyx_L1_error)
8668  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8669  __pyx_v_dim = __pyx_t_9;
8670  __pyx_v_idx = __pyx_t_8;
8671  __pyx_t_8 = (__pyx_t_8 + 1);
8672 
8673  /* "View.MemoryView":152
8674  *
8675  * for idx, dim in enumerate(shape):
8676  * if dim <= 0: # <<<<<<<<<<<<<<
8677  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8678  * self._shape[idx] = dim
8679  */
8680  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8681  if (unlikely(__pyx_t_4)) {
8682 
8683  /* "View.MemoryView":153
8684  * for idx, dim in enumerate(shape):
8685  * if dim <= 0:
8686  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
8687  * self._shape[idx] = dim
8688  *
8689  */
8690  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 153, __pyx_L1_error)
8691  __Pyx_GOTREF(__pyx_t_5);
8692  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error)
8693  __Pyx_GOTREF(__pyx_t_6);
8694  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
8695  __Pyx_GOTREF(__pyx_t_10);
8696  __Pyx_GIVEREF(__pyx_t_5);
8697  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
8698  __Pyx_GIVEREF(__pyx_t_6);
8699  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
8700  __pyx_t_5 = 0;
8701  __pyx_t_6 = 0;
8702  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error)
8703  __Pyx_GOTREF(__pyx_t_6);
8704  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8705  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
8706  __Pyx_GOTREF(__pyx_t_10);
8707  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8708  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8709  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8710  __PYX_ERR(2, 153, __pyx_L1_error)
8711 
8712  /* "View.MemoryView":152
8713  *
8714  * for idx, dim in enumerate(shape):
8715  * if dim <= 0: # <<<<<<<<<<<<<<
8716  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8717  * self._shape[idx] = dim
8718  */
8719  }
8720 
8721  /* "View.MemoryView":154
8722  * if dim <= 0:
8723  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8724  * self._shape[idx] = dim # <<<<<<<<<<<<<<
8725  *
8726  * cdef char order
8727  */
8728  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8729 
8730  /* "View.MemoryView":151
8731  *
8732  *
8733  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8734  * if dim <= 0:
8735  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8736  */
8737  }
8738  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8739 
8740  /* "View.MemoryView":157
8741  *
8742  * cdef char order
8743  * if mode == 'fortran': # <<<<<<<<<<<<<<
8744  * order = b'F'
8745  * self.mode = u'fortran'
8746  */
8747  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 157, __pyx_L1_error)
8748  if (__pyx_t_4) {
8749 
8750  /* "View.MemoryView":158
8751  * cdef char order
8752  * if mode == 'fortran':
8753  * order = b'F' # <<<<<<<<<<<<<<
8754  * self.mode = u'fortran'
8755  * elif mode == 'c':
8756  */
8757  __pyx_v_order = 'F';
8758 
8759  /* "View.MemoryView":159
8760  * if mode == 'fortran':
8761  * order = b'F'
8762  * self.mode = u'fortran' # <<<<<<<<<<<<<<
8763  * elif mode == 'c':
8764  * order = b'C'
8765  */
8766  __Pyx_INCREF(__pyx_n_u_fortran);
8767  __Pyx_GIVEREF(__pyx_n_u_fortran);
8768  __Pyx_GOTREF(__pyx_v_self->mode);
8769  __Pyx_DECREF(__pyx_v_self->mode);
8770  __pyx_v_self->mode = __pyx_n_u_fortran;
8771 
8772  /* "View.MemoryView":157
8773  *
8774  * cdef char order
8775  * if mode == 'fortran': # <<<<<<<<<<<<<<
8776  * order = b'F'
8777  * self.mode = u'fortran'
8778  */
8779  goto __pyx_L10;
8780  }
8781 
8782  /* "View.MemoryView":160
8783  * order = b'F'
8784  * self.mode = u'fortran'
8785  * elif mode == 'c': # <<<<<<<<<<<<<<
8786  * order = b'C'
8787  * self.mode = u'c'
8788  */
8789  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 160, __pyx_L1_error)
8790  if (likely(__pyx_t_4)) {
8791 
8792  /* "View.MemoryView":161
8793  * self.mode = u'fortran'
8794  * elif mode == 'c':
8795  * order = b'C' # <<<<<<<<<<<<<<
8796  * self.mode = u'c'
8797  * else:
8798  */
8799  __pyx_v_order = 'C';
8800 
8801  /* "View.MemoryView":162
8802  * elif mode == 'c':
8803  * order = b'C'
8804  * self.mode = u'c' # <<<<<<<<<<<<<<
8805  * else:
8806  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8807  */
8808  __Pyx_INCREF(__pyx_n_u_c);
8809  __Pyx_GIVEREF(__pyx_n_u_c);
8810  __Pyx_GOTREF(__pyx_v_self->mode);
8811  __Pyx_DECREF(__pyx_v_self->mode);
8812  __pyx_v_self->mode = __pyx_n_u_c;
8813 
8814  /* "View.MemoryView":160
8815  * order = b'F'
8816  * self.mode = u'fortran'
8817  * elif mode == 'c': # <<<<<<<<<<<<<<
8818  * order = b'C'
8819  * self.mode = u'c'
8820  */
8821  goto __pyx_L10;
8822  }
8823 
8824  /* "View.MemoryView":164
8825  * self.mode = u'c'
8826  * else:
8827  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
8828  *
8829  * self.len = fill_contig_strides_array(self._shape, self._strides,
8830  */
8831  /*else*/ {
8832  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 164, __pyx_L1_error)
8833  __Pyx_GOTREF(__pyx_t_3);
8834  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 164, __pyx_L1_error)
8835  __Pyx_GOTREF(__pyx_t_10);
8836  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8837  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8838  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8839  __PYX_ERR(2, 164, __pyx_L1_error)
8840  }
8841  __pyx_L10:;
8842 
8843  /* "View.MemoryView":166
8844  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8845  *
8846  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
8847  * itemsize, self.ndim, order)
8848  *
8849  */
8850  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
8851 
8852  /* "View.MemoryView":169
8853  * itemsize, self.ndim, order)
8854  *
8855  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
8856  * self.dtype_is_object = format == b'O'
8857  * if allocate_buffer:
8858  */
8859  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8860 
8861  /* "View.MemoryView":170
8862  *
8863  * self.free_data = allocate_buffer
8864  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
8865  * if allocate_buffer:
8866  *
8867  */
8868  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 170, __pyx_L1_error)
8869  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 170, __pyx_L1_error)
8870  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8871  __pyx_v_self->dtype_is_object = __pyx_t_4;
8872 
8873  /* "View.MemoryView":171
8874  * self.free_data = allocate_buffer
8875  * self.dtype_is_object = format == b'O'
8876  * if allocate_buffer: # <<<<<<<<<<<<<<
8877  *
8878  *
8879  */
8880  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8881  if (__pyx_t_4) {
8882 
8883  /* "View.MemoryView":174
8884  *
8885  *
8886  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
8887  * if not self.data:
8888  * raise MemoryError("unable to allocate array data.")
8889  */
8890  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
8891 
8892  /* "View.MemoryView":175
8893  *
8894  * self.data = <char *>malloc(self.len)
8895  * if not self.data: # <<<<<<<<<<<<<<
8896  * raise MemoryError("unable to allocate array data.")
8897  *
8898  */
8899  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
8900  if (unlikely(__pyx_t_4)) {
8901 
8902  /* "View.MemoryView":176
8903  * self.data = <char *>malloc(self.len)
8904  * if not self.data:
8905  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
8906  *
8907  * if self.dtype_is_object:
8908  */
8909  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 176, __pyx_L1_error)
8910  __Pyx_GOTREF(__pyx_t_10);
8911  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8912  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8913  __PYX_ERR(2, 176, __pyx_L1_error)
8914 
8915  /* "View.MemoryView":175
8916  *
8917  * self.data = <char *>malloc(self.len)
8918  * if not self.data: # <<<<<<<<<<<<<<
8919  * raise MemoryError("unable to allocate array data.")
8920  *
8921  */
8922  }
8923 
8924  /* "View.MemoryView":178
8925  * raise MemoryError("unable to allocate array data.")
8926  *
8927  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8928  * p = <PyObject **> self.data
8929  * for i in range(self.len / itemsize):
8930  */
8931  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
8932  if (__pyx_t_4) {
8933 
8934  /* "View.MemoryView":179
8935  *
8936  * if self.dtype_is_object:
8937  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
8938  * for i in range(self.len / itemsize):
8939  * p[i] = Py_None
8940  */
8941  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
8942 
8943  /* "View.MemoryView":180
8944  * if self.dtype_is_object:
8945  * p = <PyObject **> self.data
8946  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
8947  * p[i] = Py_None
8948  * Py_INCREF(Py_None)
8949  */
8950  if (unlikely(__pyx_v_itemsize == 0)) {
8951  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
8952  __PYX_ERR(2, 180, __pyx_L1_error)
8953  }
8954  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
8955  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
8956  __PYX_ERR(2, 180, __pyx_L1_error)
8957  }
8958  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
8959  __pyx_t_9 = __pyx_t_1;
8960  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
8961  __pyx_v_i = __pyx_t_11;
8962 
8963  /* "View.MemoryView":181
8964  * p = <PyObject **> self.data
8965  * for i in range(self.len / itemsize):
8966  * p[i] = Py_None # <<<<<<<<<<<<<<
8967  * Py_INCREF(Py_None)
8968  *
8969  */
8970  (__pyx_v_p[__pyx_v_i]) = Py_None;
8971 
8972  /* "View.MemoryView":182
8973  * for i in range(self.len / itemsize):
8974  * p[i] = Py_None
8975  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
8976  *
8977  * @cname('getbuffer')
8978  */
8979  Py_INCREF(Py_None);
8980  }
8981 
8982  /* "View.MemoryView":178
8983  * raise MemoryError("unable to allocate array data.")
8984  *
8985  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8986  * p = <PyObject **> self.data
8987  * for i in range(self.len / itemsize):
8988  */
8989  }
8990 
8991  /* "View.MemoryView":171
8992  * self.free_data = allocate_buffer
8993  * self.dtype_is_object = format == b'O'
8994  * if allocate_buffer: # <<<<<<<<<<<<<<
8995  *
8996  *
8997  */
8998  }
8999 
9000  /* "View.MemoryView":122
9001  * cdef bint dtype_is_object
9002  *
9003  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
9004  * mode="c", bint allocate_buffer=True):
9005  *
9006  */
9007 
9008  /* function exit code */
9009  __pyx_r = 0;
9010  goto __pyx_L0;
9011  __pyx_L1_error:;
9012  __Pyx_XDECREF(__pyx_t_3);
9013  __Pyx_XDECREF(__pyx_t_5);
9014  __Pyx_XDECREF(__pyx_t_6);
9015  __Pyx_XDECREF(__pyx_t_10);
9016  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9017  __pyx_r = -1;
9018  __pyx_L0:;
9019  __Pyx_XDECREF(__pyx_v_format);
9020  __Pyx_RefNannyFinishContext();
9021  return __pyx_r;
9022 }
9023 
9024 /* "View.MemoryView":185
9025  *
9026  * @cname('getbuffer')
9027  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9028  * cdef int bufmode = -1
9029  * if self.mode == u"c":
9030  */
9031 
9032 /* Python wrapper */
9033 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
9034 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9035  int __pyx_r;
9036  __Pyx_RefNannyDeclarations
9037  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
9038  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
9039 
9040  /* function exit code */
9041  __Pyx_RefNannyFinishContext();
9042  return __pyx_r;
9043 }
9044 
9045 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9046  int __pyx_v_bufmode;
9047  int __pyx_r;
9048  __Pyx_RefNannyDeclarations
9049  int __pyx_t_1;
9050  int __pyx_t_2;
9051  PyObject *__pyx_t_3 = NULL;
9052  char *__pyx_t_4;
9053  Py_ssize_t __pyx_t_5;
9054  int __pyx_t_6;
9055  Py_ssize_t *__pyx_t_7;
9056  int __pyx_lineno = 0;
9057  const char *__pyx_filename = NULL;
9058  int __pyx_clineno = 0;
9059  if (__pyx_v_info == NULL) {
9060  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
9061  return -1;
9062  }
9063  __Pyx_RefNannySetupContext("__getbuffer__", 0);
9064  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9065  __Pyx_GIVEREF(__pyx_v_info->obj);
9066 
9067  /* "View.MemoryView":186
9068  * @cname('getbuffer')
9069  * def __getbuffer__(self, Py_buffer *info, int flags):
9070  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
9071  * if self.mode == u"c":
9072  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9073  */
9074  __pyx_v_bufmode = -1;
9075 
9076  /* "View.MemoryView":187
9077  * def __getbuffer__(self, Py_buffer *info, int flags):
9078  * cdef int bufmode = -1
9079  * if self.mode == u"c": # <<<<<<<<<<<<<<
9080  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9081  * elif self.mode == u"fortran":
9082  */
9083  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 187, __pyx_L1_error)
9084  __pyx_t_2 = (__pyx_t_1 != 0);
9085  if (__pyx_t_2) {
9086 
9087  /* "View.MemoryView":188
9088  * cdef int bufmode = -1
9089  * if self.mode == u"c":
9090  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9091  * elif self.mode == u"fortran":
9092  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9093  */
9094  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9095 
9096  /* "View.MemoryView":187
9097  * def __getbuffer__(self, Py_buffer *info, int flags):
9098  * cdef int bufmode = -1
9099  * if self.mode == u"c": # <<<<<<<<<<<<<<
9100  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9101  * elif self.mode == u"fortran":
9102  */
9103  goto __pyx_L3;
9104  }
9105 
9106  /* "View.MemoryView":189
9107  * if self.mode == u"c":
9108  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9109  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9110  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9111  * if not (flags & bufmode):
9112  */
9113  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 189, __pyx_L1_error)
9114  __pyx_t_1 = (__pyx_t_2 != 0);
9115  if (__pyx_t_1) {
9116 
9117  /* "View.MemoryView":190
9118  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9119  * elif self.mode == u"fortran":
9120  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9121  * if not (flags & bufmode):
9122  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9123  */
9124  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9125 
9126  /* "View.MemoryView":189
9127  * if self.mode == u"c":
9128  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9129  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9130  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9131  * if not (flags & bufmode):
9132  */
9133  }
9134  __pyx_L3:;
9135 
9136  /* "View.MemoryView":191
9137  * elif self.mode == u"fortran":
9138  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9139  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9140  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9141  * info.buf = self.data
9142  */
9143  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
9144  if (unlikely(__pyx_t_1)) {
9145 
9146  /* "View.MemoryView":192
9147  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9148  * if not (flags & bufmode):
9149  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
9150  * info.buf = self.data
9151  * info.len = self.len
9152  */
9153  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 192, __pyx_L1_error)
9154  __Pyx_GOTREF(__pyx_t_3);
9155  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9156  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9157  __PYX_ERR(2, 192, __pyx_L1_error)
9158 
9159  /* "View.MemoryView":191
9160  * elif self.mode == u"fortran":
9161  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9162  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9163  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9164  * info.buf = self.data
9165  */
9166  }
9167 
9168  /* "View.MemoryView":193
9169  * if not (flags & bufmode):
9170  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9171  * info.buf = self.data # <<<<<<<<<<<<<<
9172  * info.len = self.len
9173  * info.ndim = self.ndim
9174  */
9175  __pyx_t_4 = __pyx_v_self->data;
9176  __pyx_v_info->buf = __pyx_t_4;
9177 
9178  /* "View.MemoryView":194
9179  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9180  * info.buf = self.data
9181  * info.len = self.len # <<<<<<<<<<<<<<
9182  * info.ndim = self.ndim
9183  * info.shape = self._shape
9184  */
9185  __pyx_t_5 = __pyx_v_self->len;
9186  __pyx_v_info->len = __pyx_t_5;
9187 
9188  /* "View.MemoryView":195
9189  * info.buf = self.data
9190  * info.len = self.len
9191  * info.ndim = self.ndim # <<<<<<<<<<<<<<
9192  * info.shape = self._shape
9193  * info.strides = self._strides
9194  */
9195  __pyx_t_6 = __pyx_v_self->ndim;
9196  __pyx_v_info->ndim = __pyx_t_6;
9197 
9198  /* "View.MemoryView":196
9199  * info.len = self.len
9200  * info.ndim = self.ndim
9201  * info.shape = self._shape # <<<<<<<<<<<<<<
9202  * info.strides = self._strides
9203  * info.suboffsets = NULL
9204  */
9205  __pyx_t_7 = __pyx_v_self->_shape;
9206  __pyx_v_info->shape = __pyx_t_7;
9207 
9208  /* "View.MemoryView":197
9209  * info.ndim = self.ndim
9210  * info.shape = self._shape
9211  * info.strides = self._strides # <<<<<<<<<<<<<<
9212  * info.suboffsets = NULL
9213  * info.itemsize = self.itemsize
9214  */
9215  __pyx_t_7 = __pyx_v_self->_strides;
9216  __pyx_v_info->strides = __pyx_t_7;
9217 
9218  /* "View.MemoryView":198
9219  * info.shape = self._shape
9220  * info.strides = self._strides
9221  * info.suboffsets = NULL # <<<<<<<<<<<<<<
9222  * info.itemsize = self.itemsize
9223  * info.readonly = 0
9224  */
9225  __pyx_v_info->suboffsets = NULL;
9226 
9227  /* "View.MemoryView":199
9228  * info.strides = self._strides
9229  * info.suboffsets = NULL
9230  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
9231  * info.readonly = 0
9232  *
9233  */
9234  __pyx_t_5 = __pyx_v_self->itemsize;
9235  __pyx_v_info->itemsize = __pyx_t_5;
9236 
9237  /* "View.MemoryView":200
9238  * info.suboffsets = NULL
9239  * info.itemsize = self.itemsize
9240  * info.readonly = 0 # <<<<<<<<<<<<<<
9241  *
9242  * if flags & PyBUF_FORMAT:
9243  */
9244  __pyx_v_info->readonly = 0;
9245 
9246  /* "View.MemoryView":202
9247  * info.readonly = 0
9248  *
9249  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9250  * info.format = self.format
9251  * else:
9252  */
9253  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9254  if (__pyx_t_1) {
9255 
9256  /* "View.MemoryView":203
9257  *
9258  * if flags & PyBUF_FORMAT:
9259  * info.format = self.format # <<<<<<<<<<<<<<
9260  * else:
9261  * info.format = NULL
9262  */
9263  __pyx_t_4 = __pyx_v_self->format;
9264  __pyx_v_info->format = __pyx_t_4;
9265 
9266  /* "View.MemoryView":202
9267  * info.readonly = 0
9268  *
9269  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9270  * info.format = self.format
9271  * else:
9272  */
9273  goto __pyx_L5;
9274  }
9275 
9276  /* "View.MemoryView":205
9277  * info.format = self.format
9278  * else:
9279  * info.format = NULL # <<<<<<<<<<<<<<
9280  *
9281  * info.obj = self
9282  */
9283  /*else*/ {
9284  __pyx_v_info->format = NULL;
9285  }
9286  __pyx_L5:;
9287 
9288  /* "View.MemoryView":207
9289  * info.format = NULL
9290  *
9291  * info.obj = self # <<<<<<<<<<<<<<
9292  *
9293  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9294  */
9295  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9296  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9297  __Pyx_GOTREF(__pyx_v_info->obj);
9298  __Pyx_DECREF(__pyx_v_info->obj);
9299  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9300 
9301  /* "View.MemoryView":185
9302  *
9303  * @cname('getbuffer')
9304  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9305  * cdef int bufmode = -1
9306  * if self.mode == u"c":
9307  */
9308 
9309  /* function exit code */
9310  __pyx_r = 0;
9311  goto __pyx_L0;
9312  __pyx_L1_error:;
9313  __Pyx_XDECREF(__pyx_t_3);
9314  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9315  __pyx_r = -1;
9316  if (__pyx_v_info->obj != NULL) {
9317  __Pyx_GOTREF(__pyx_v_info->obj);
9318  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9319  }
9320  goto __pyx_L2;
9321  __pyx_L0:;
9322  if (__pyx_v_info->obj == Py_None) {
9323  __Pyx_GOTREF(__pyx_v_info->obj);
9324  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9325  }
9326  __pyx_L2:;
9327  __Pyx_RefNannyFinishContext();
9328  return __pyx_r;
9329 }
9330 
9331 /* "View.MemoryView":211
9332  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9333  *
9334  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9335  * if self.callback_free_data != NULL:
9336  * self.callback_free_data(self.data)
9337  */
9338 
9339 /* Python wrapper */
9340 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
9341 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
9342  __Pyx_RefNannyDeclarations
9343  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
9344  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
9345 
9346  /* function exit code */
9347  __Pyx_RefNannyFinishContext();
9348 }
9349 
9350 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
9351  __Pyx_RefNannyDeclarations
9352  int __pyx_t_1;
9353  __Pyx_RefNannySetupContext("__dealloc__", 0);
9354 
9355  /* "View.MemoryView":212
9356  *
9357  * def __dealloc__(array self):
9358  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9359  * self.callback_free_data(self.data)
9360  * elif self.free_data:
9361  */
9362  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
9363  if (__pyx_t_1) {
9364 
9365  /* "View.MemoryView":213
9366  * def __dealloc__(array self):
9367  * if self.callback_free_data != NULL:
9368  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
9369  * elif self.free_data:
9370  * if self.dtype_is_object:
9371  */
9372  __pyx_v_self->callback_free_data(__pyx_v_self->data);
9373 
9374  /* "View.MemoryView":212
9375  *
9376  * def __dealloc__(array self):
9377  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9378  * self.callback_free_data(self.data)
9379  * elif self.free_data:
9380  */
9381  goto __pyx_L3;
9382  }
9383 
9384  /* "View.MemoryView":214
9385  * if self.callback_free_data != NULL:
9386  * self.callback_free_data(self.data)
9387  * elif self.free_data: # <<<<<<<<<<<<<<
9388  * if self.dtype_is_object:
9389  * refcount_objects_in_slice(self.data, self._shape,
9390  */
9391  __pyx_t_1 = (__pyx_v_self->free_data != 0);
9392  if (__pyx_t_1) {
9393 
9394  /* "View.MemoryView":215
9395  * self.callback_free_data(self.data)
9396  * elif self.free_data:
9397  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9398  * refcount_objects_in_slice(self.data, self._shape,
9399  * self._strides, self.ndim, False)
9400  */
9401  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9402  if (__pyx_t_1) {
9403 
9404  /* "View.MemoryView":216
9405  * elif self.free_data:
9406  * if self.dtype_is_object:
9407  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
9408  * self._strides, self.ndim, False)
9409  * free(self.data)
9410  */
9411  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
9412 
9413  /* "View.MemoryView":215
9414  * self.callback_free_data(self.data)
9415  * elif self.free_data:
9416  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9417  * refcount_objects_in_slice(self.data, self._shape,
9418  * self._strides, self.ndim, False)
9419  */
9420  }
9421 
9422  /* "View.MemoryView":218
9423  * refcount_objects_in_slice(self.data, self._shape,
9424  * self._strides, self.ndim, False)
9425  * free(self.data) # <<<<<<<<<<<<<<
9426  * PyObject_Free(self._shape)
9427  *
9428  */
9429  free(__pyx_v_self->data);
9430 
9431  /* "View.MemoryView":214
9432  * if self.callback_free_data != NULL:
9433  * self.callback_free_data(self.data)
9434  * elif self.free_data: # <<<<<<<<<<<<<<
9435  * if self.dtype_is_object:
9436  * refcount_objects_in_slice(self.data, self._shape,
9437  */
9438  }
9439  __pyx_L3:;
9440 
9441  /* "View.MemoryView":219
9442  * self._strides, self.ndim, False)
9443  * free(self.data)
9444  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
9445  *
9446  * @property
9447  */
9448  PyObject_Free(__pyx_v_self->_shape);
9449 
9450  /* "View.MemoryView":211
9451  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9452  *
9453  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9454  * if self.callback_free_data != NULL:
9455  * self.callback_free_data(self.data)
9456  */
9457 
9458  /* function exit code */
9459  __Pyx_RefNannyFinishContext();
9460 }
9461 
9462 /* "View.MemoryView":222
9463  *
9464  * @property
9465  * def memview(self): # <<<<<<<<<<<<<<
9466  * return self.get_memview()
9467  *
9468  */
9469 
9470 /* Python wrapper */
9471 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
9472 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
9473  PyObject *__pyx_r = 0;
9474  __Pyx_RefNannyDeclarations
9475  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9476  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
9477 
9478  /* function exit code */
9479  __Pyx_RefNannyFinishContext();
9480  return __pyx_r;
9481 }
9482 
9483 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
9484  PyObject *__pyx_r = NULL;
9485  __Pyx_RefNannyDeclarations
9486  PyObject *__pyx_t_1 = NULL;
9487  int __pyx_lineno = 0;
9488  const char *__pyx_filename = NULL;
9489  int __pyx_clineno = 0;
9490  __Pyx_RefNannySetupContext("__get__", 0);
9491 
9492  /* "View.MemoryView":223
9493  * @property
9494  * def memview(self):
9495  * return self.get_memview() # <<<<<<<<<<<<<<
9496  *
9497  * @cname('get_memview')
9498  */
9499  __Pyx_XDECREF(__pyx_r);
9500  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 223, __pyx_L1_error)
9501  __Pyx_GOTREF(__pyx_t_1);
9502  __pyx_r = __pyx_t_1;
9503  __pyx_t_1 = 0;
9504  goto __pyx_L0;
9505 
9506  /* "View.MemoryView":222
9507  *
9508  * @property
9509  * def memview(self): # <<<<<<<<<<<<<<
9510  * return self.get_memview()
9511  *
9512  */
9513 
9514  /* function exit code */
9515  __pyx_L1_error:;
9516  __Pyx_XDECREF(__pyx_t_1);
9517  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9518  __pyx_r = NULL;
9519  __pyx_L0:;
9520  __Pyx_XGIVEREF(__pyx_r);
9521  __Pyx_RefNannyFinishContext();
9522  return __pyx_r;
9523 }
9524 
9525 /* "View.MemoryView":226
9526  *
9527  * @cname('get_memview')
9528  * cdef get_memview(self): # <<<<<<<<<<<<<<
9529  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9530  * return memoryview(self, flags, self.dtype_is_object)
9531  */
9532 
9533 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
9534  int __pyx_v_flags;
9535  PyObject *__pyx_r = NULL;
9536  __Pyx_RefNannyDeclarations
9537  PyObject *__pyx_t_1 = NULL;
9538  PyObject *__pyx_t_2 = NULL;
9539  PyObject *__pyx_t_3 = NULL;
9540  int __pyx_lineno = 0;
9541  const char *__pyx_filename = NULL;
9542  int __pyx_clineno = 0;
9543  __Pyx_RefNannySetupContext("get_memview", 0);
9544 
9545  /* "View.MemoryView":227
9546  * @cname('get_memview')
9547  * cdef get_memview(self):
9548  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
9549  * return memoryview(self, flags, self.dtype_is_object)
9550  *
9551  */
9552  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9553 
9554  /* "View.MemoryView":228
9555  * cdef get_memview(self):
9556  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9557  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
9558  *
9559  * def __len__(self):
9560  */
9561  __Pyx_XDECREF(__pyx_r);
9562  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 228, __pyx_L1_error)
9563  __Pyx_GOTREF(__pyx_t_1);
9564  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
9565  __Pyx_GOTREF(__pyx_t_2);
9566  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 228, __pyx_L1_error)
9567  __Pyx_GOTREF(__pyx_t_3);
9568  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9569  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9570  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9571  __Pyx_GIVEREF(__pyx_t_1);
9572  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9573  __Pyx_GIVEREF(__pyx_t_2);
9574  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9575  __pyx_t_1 = 0;
9576  __pyx_t_2 = 0;
9577  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
9578  __Pyx_GOTREF(__pyx_t_2);
9579  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9580  __pyx_r = __pyx_t_2;
9581  __pyx_t_2 = 0;
9582  goto __pyx_L0;
9583 
9584  /* "View.MemoryView":226
9585  *
9586  * @cname('get_memview')
9587  * cdef get_memview(self): # <<<<<<<<<<<<<<
9588  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9589  * return memoryview(self, flags, self.dtype_is_object)
9590  */
9591 
9592  /* function exit code */
9593  __pyx_L1_error:;
9594  __Pyx_XDECREF(__pyx_t_1);
9595  __Pyx_XDECREF(__pyx_t_2);
9596  __Pyx_XDECREF(__pyx_t_3);
9597  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9598  __pyx_r = 0;
9599  __pyx_L0:;
9600  __Pyx_XGIVEREF(__pyx_r);
9601  __Pyx_RefNannyFinishContext();
9602  return __pyx_r;
9603 }
9604 
9605 /* "View.MemoryView":230
9606  * return memoryview(self, flags, self.dtype_is_object)
9607  *
9608  * def __len__(self): # <<<<<<<<<<<<<<
9609  * return self._shape[0]
9610  *
9611  */
9612 
9613 /* Python wrapper */
9614 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
9615 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9616  Py_ssize_t __pyx_r;
9617  __Pyx_RefNannyDeclarations
9618  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
9619  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
9620 
9621  /* function exit code */
9622  __Pyx_RefNannyFinishContext();
9623  return __pyx_r;
9624 }
9625 
9626 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
9627  Py_ssize_t __pyx_r;
9628  __Pyx_RefNannyDeclarations
9629  __Pyx_RefNannySetupContext("__len__", 0);
9630 
9631  /* "View.MemoryView":231
9632  *
9633  * def __len__(self):
9634  * return self._shape[0] # <<<<<<<<<<<<<<
9635  *
9636  * def __getattr__(self, attr):
9637  */
9638  __pyx_r = (__pyx_v_self->_shape[0]);
9639  goto __pyx_L0;
9640 
9641  /* "View.MemoryView":230
9642  * return memoryview(self, flags, self.dtype_is_object)
9643  *
9644  * def __len__(self): # <<<<<<<<<<<<<<
9645  * return self._shape[0]
9646  *
9647  */
9648 
9649  /* function exit code */
9650  __pyx_L0:;
9651  __Pyx_RefNannyFinishContext();
9652  return __pyx_r;
9653 }
9654 
9655 /* "View.MemoryView":233
9656  * return self._shape[0]
9657  *
9658  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9659  * return getattr(self.memview, attr)
9660  *
9661  */
9662 
9663 /* Python wrapper */
9664 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
9665 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9666  PyObject *__pyx_r = 0;
9667  __Pyx_RefNannyDeclarations
9668  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
9669  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9670 
9671  /* function exit code */
9672  __Pyx_RefNannyFinishContext();
9673  return __pyx_r;
9674 }
9675 
9676 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9677  PyObject *__pyx_r = NULL;
9678  __Pyx_RefNannyDeclarations
9679  PyObject *__pyx_t_1 = NULL;
9680  PyObject *__pyx_t_2 = NULL;
9681  int __pyx_lineno = 0;
9682  const char *__pyx_filename = NULL;
9683  int __pyx_clineno = 0;
9684  __Pyx_RefNannySetupContext("__getattr__", 0);
9685 
9686  /* "View.MemoryView":234
9687  *
9688  * def __getattr__(self, attr):
9689  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
9690  *
9691  * def __getitem__(self, item):
9692  */
9693  __Pyx_XDECREF(__pyx_r);
9694  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 234, __pyx_L1_error)
9695  __Pyx_GOTREF(__pyx_t_1);
9696  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 234, __pyx_L1_error)
9697  __Pyx_GOTREF(__pyx_t_2);
9698  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9699  __pyx_r = __pyx_t_2;
9700  __pyx_t_2 = 0;
9701  goto __pyx_L0;
9702 
9703  /* "View.MemoryView":233
9704  * return self._shape[0]
9705  *
9706  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9707  * return getattr(self.memview, attr)
9708  *
9709  */
9710 
9711  /* function exit code */
9712  __pyx_L1_error:;
9713  __Pyx_XDECREF(__pyx_t_1);
9714  __Pyx_XDECREF(__pyx_t_2);
9715  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9716  __pyx_r = NULL;
9717  __pyx_L0:;
9718  __Pyx_XGIVEREF(__pyx_r);
9719  __Pyx_RefNannyFinishContext();
9720  return __pyx_r;
9721 }
9722 
9723 /* "View.MemoryView":236
9724  * return getattr(self.memview, attr)
9725  *
9726  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9727  * return self.memview[item]
9728  *
9729  */
9730 
9731 /* Python wrapper */
9732 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
9733 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9734  PyObject *__pyx_r = 0;
9735  __Pyx_RefNannyDeclarations
9736  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9737  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9738 
9739  /* function exit code */
9740  __Pyx_RefNannyFinishContext();
9741  return __pyx_r;
9742 }
9743 
9744 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9745  PyObject *__pyx_r = NULL;
9746  __Pyx_RefNannyDeclarations
9747  PyObject *__pyx_t_1 = NULL;
9748  PyObject *__pyx_t_2 = NULL;
9749  int __pyx_lineno = 0;
9750  const char *__pyx_filename = NULL;
9751  int __pyx_clineno = 0;
9752  __Pyx_RefNannySetupContext("__getitem__", 0);
9753 
9754  /* "View.MemoryView":237
9755  *
9756  * def __getitem__(self, item):
9757  * return self.memview[item] # <<<<<<<<<<<<<<
9758  *
9759  * def __setitem__(self, item, value):
9760  */
9761  __Pyx_XDECREF(__pyx_r);
9762  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 237, __pyx_L1_error)
9763  __Pyx_GOTREF(__pyx_t_1);
9764  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 237, __pyx_L1_error)
9765  __Pyx_GOTREF(__pyx_t_2);
9766  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9767  __pyx_r = __pyx_t_2;
9768  __pyx_t_2 = 0;
9769  goto __pyx_L0;
9770 
9771  /* "View.MemoryView":236
9772  * return getattr(self.memview, attr)
9773  *
9774  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9775  * return self.memview[item]
9776  *
9777  */
9778 
9779  /* function exit code */
9780  __pyx_L1_error:;
9781  __Pyx_XDECREF(__pyx_t_1);
9782  __Pyx_XDECREF(__pyx_t_2);
9783  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9784  __pyx_r = NULL;
9785  __pyx_L0:;
9786  __Pyx_XGIVEREF(__pyx_r);
9787  __Pyx_RefNannyFinishContext();
9788  return __pyx_r;
9789 }
9790 
9791 /* "View.MemoryView":239
9792  * return self.memview[item]
9793  *
9794  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9795  * self.memview[item] = value
9796  *
9797  */
9798 
9799 /* Python wrapper */
9800 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
9801 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9802  int __pyx_r;
9803  __Pyx_RefNannyDeclarations
9804  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9805  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
9806 
9807  /* function exit code */
9808  __Pyx_RefNannyFinishContext();
9809  return __pyx_r;
9810 }
9811 
9812 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9813  int __pyx_r;
9814  __Pyx_RefNannyDeclarations
9815  PyObject *__pyx_t_1 = NULL;
9816  int __pyx_lineno = 0;
9817  const char *__pyx_filename = NULL;
9818  int __pyx_clineno = 0;
9819  __Pyx_RefNannySetupContext("__setitem__", 0);
9820 
9821  /* "View.MemoryView":240
9822  *
9823  * def __setitem__(self, item, value):
9824  * self.memview[item] = value # <<<<<<<<<<<<<<
9825  *
9826  *
9827  */
9828  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 240, __pyx_L1_error)
9829  __Pyx_GOTREF(__pyx_t_1);
9830  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 240, __pyx_L1_error)
9831  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9832 
9833  /* "View.MemoryView":239
9834  * return self.memview[item]
9835  *
9836  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9837  * self.memview[item] = value
9838  *
9839  */
9840 
9841  /* function exit code */
9842  __pyx_r = 0;
9843  goto __pyx_L0;
9844  __pyx_L1_error:;
9845  __Pyx_XDECREF(__pyx_t_1);
9846  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9847  __pyx_r = -1;
9848  __pyx_L0:;
9849  __Pyx_RefNannyFinishContext();
9850  return __pyx_r;
9851 }
9852 
9853 /* "(tree fragment)":1
9854  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9855  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9856  * def __setstate_cython__(self, __pyx_state):
9857  */
9858 
9859 /* Python wrapper */
9860 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9861 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9862  PyObject *__pyx_r = 0;
9863  __Pyx_RefNannyDeclarations
9864  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9865  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
9866 
9867  /* function exit code */
9868  __Pyx_RefNannyFinishContext();
9869  return __pyx_r;
9870 }
9871 
9872 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
9873  PyObject *__pyx_r = NULL;
9874  __Pyx_RefNannyDeclarations
9875  PyObject *__pyx_t_1 = NULL;
9876  int __pyx_lineno = 0;
9877  const char *__pyx_filename = NULL;
9878  int __pyx_clineno = 0;
9879  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9880 
9881  /* "(tree fragment)":2
9882  * def __reduce_cython__(self):
9883  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9884  * def __setstate_cython__(self, __pyx_state):
9885  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9886  */
9887  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
9888  __Pyx_GOTREF(__pyx_t_1);
9889  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9890  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9891  __PYX_ERR(2, 2, __pyx_L1_error)
9892 
9893  /* "(tree fragment)":1
9894  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9895  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9896  * def __setstate_cython__(self, __pyx_state):
9897  */
9898 
9899  /* function exit code */
9900  __pyx_L1_error:;
9901  __Pyx_XDECREF(__pyx_t_1);
9902  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9903  __pyx_r = NULL;
9904  __Pyx_XGIVEREF(__pyx_r);
9905  __Pyx_RefNannyFinishContext();
9906  return __pyx_r;
9907 }
9908 
9909 /* "(tree fragment)":3
9910  * def __reduce_cython__(self):
9911  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9912  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9913  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9914  */
9915 
9916 /* Python wrapper */
9917 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9918 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9919  PyObject *__pyx_r = 0;
9920  __Pyx_RefNannyDeclarations
9921  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9922  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9923 
9924  /* function exit code */
9925  __Pyx_RefNannyFinishContext();
9926  return __pyx_r;
9927 }
9928 
9929 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
9930  PyObject *__pyx_r = NULL;
9931  __Pyx_RefNannyDeclarations
9932  PyObject *__pyx_t_1 = NULL;
9933  int __pyx_lineno = 0;
9934  const char *__pyx_filename = NULL;
9935  int __pyx_clineno = 0;
9936  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9937 
9938  /* "(tree fragment)":4
9939  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9940  * def __setstate_cython__(self, __pyx_state):
9941  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9942  */
9943  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
9944  __Pyx_GOTREF(__pyx_t_1);
9945  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9946  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9947  __PYX_ERR(2, 4, __pyx_L1_error)
9948 
9949  /* "(tree fragment)":3
9950  * def __reduce_cython__(self):
9951  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9952  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9953  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9954  */
9955 
9956  /* function exit code */
9957  __pyx_L1_error:;
9958  __Pyx_XDECREF(__pyx_t_1);
9959  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9960  __pyx_r = NULL;
9961  __Pyx_XGIVEREF(__pyx_r);
9962  __Pyx_RefNannyFinishContext();
9963  return __pyx_r;
9964 }
9965 
9966 /* "View.MemoryView":244
9967  *
9968  * @cname("__pyx_array_new")
9969  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9970  * char *mode, char *buf):
9971  * cdef array result
9972  */
9973 
9974 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
9975  struct __pyx_array_obj *__pyx_v_result = 0;
9976  struct __pyx_array_obj *__pyx_r = NULL;
9977  __Pyx_RefNannyDeclarations
9978  int __pyx_t_1;
9979  PyObject *__pyx_t_2 = NULL;
9980  PyObject *__pyx_t_3 = NULL;
9981  PyObject *__pyx_t_4 = NULL;
9982  PyObject *__pyx_t_5 = NULL;
9983  int __pyx_lineno = 0;
9984  const char *__pyx_filename = NULL;
9985  int __pyx_clineno = 0;
9986  __Pyx_RefNannySetupContext("array_cwrapper", 0);
9987 
9988  /* "View.MemoryView":248
9989  * cdef array result
9990  *
9991  * if buf == NULL: # <<<<<<<<<<<<<<
9992  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9993  * else:
9994  */
9995  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
9996  if (__pyx_t_1) {
9997 
9998  /* "View.MemoryView":249
9999  *
10000  * if buf == NULL:
10001  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
10002  * else:
10003  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10004  */
10005  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 249, __pyx_L1_error)
10006  __Pyx_GOTREF(__pyx_t_2);
10007  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 249, __pyx_L1_error)
10008  __Pyx_GOTREF(__pyx_t_3);
10009  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error)
10010  __Pyx_GOTREF(__pyx_t_4);
10011  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 249, __pyx_L1_error)
10012  __Pyx_GOTREF(__pyx_t_5);
10013  __Pyx_INCREF(__pyx_v_shape);
10014  __Pyx_GIVEREF(__pyx_v_shape);
10015  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
10016  __Pyx_GIVEREF(__pyx_t_2);
10017  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
10018  __Pyx_GIVEREF(__pyx_t_3);
10019  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
10020  __Pyx_GIVEREF(__pyx_t_4);
10021  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
10022  __pyx_t_2 = 0;
10023  __pyx_t_3 = 0;
10024  __pyx_t_4 = 0;
10025  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error)
10026  __Pyx_GOTREF(__pyx_t_4);
10027  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10028  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
10029  __pyx_t_4 = 0;
10030 
10031  /* "View.MemoryView":248
10032  * cdef array result
10033  *
10034  * if buf == NULL: # <<<<<<<<<<<<<<
10035  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10036  * else:
10037  */
10038  goto __pyx_L3;
10039  }
10040 
10041  /* "View.MemoryView":251
10042  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10043  * else:
10044  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10045  * allocate_buffer=False)
10046  * result.data = buf
10047  */
10048  /*else*/ {
10049  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 251, __pyx_L1_error)
10050  __Pyx_GOTREF(__pyx_t_4);
10051  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
10052  __Pyx_GOTREF(__pyx_t_5);
10053  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 251, __pyx_L1_error)
10054  __Pyx_GOTREF(__pyx_t_3);
10055  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 251, __pyx_L1_error)
10056  __Pyx_GOTREF(__pyx_t_2);
10057  __Pyx_INCREF(__pyx_v_shape);
10058  __Pyx_GIVEREF(__pyx_v_shape);
10059  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
10060  __Pyx_GIVEREF(__pyx_t_4);
10061  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
10062  __Pyx_GIVEREF(__pyx_t_5);
10063  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
10064  __Pyx_GIVEREF(__pyx_t_3);
10065  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
10066  __pyx_t_4 = 0;
10067  __pyx_t_5 = 0;
10068  __pyx_t_3 = 0;
10069 
10070  /* "View.MemoryView":252
10071  * else:
10072  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10073  * allocate_buffer=False) # <<<<<<<<<<<<<<
10074  * result.data = buf
10075  *
10076  */
10077  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error)
10078  __Pyx_GOTREF(__pyx_t_3);
10079  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 252, __pyx_L1_error)
10080 
10081  /* "View.MemoryView":251
10082  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10083  * else:
10084  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10085  * allocate_buffer=False)
10086  * result.data = buf
10087  */
10088  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
10089  __Pyx_GOTREF(__pyx_t_5);
10090  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10091  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10092  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
10093  __pyx_t_5 = 0;
10094 
10095  /* "View.MemoryView":253
10096  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10097  * allocate_buffer=False)
10098  * result.data = buf # <<<<<<<<<<<<<<
10099  *
10100  * return result
10101  */
10102  __pyx_v_result->data = __pyx_v_buf;
10103  }
10104  __pyx_L3:;
10105 
10106  /* "View.MemoryView":255
10107  * result.data = buf
10108  *
10109  * return result # <<<<<<<<<<<<<<
10110  *
10111  *
10112  */
10113  __Pyx_XDECREF(((PyObject *)__pyx_r));
10114  __Pyx_INCREF(((PyObject *)__pyx_v_result));
10115  __pyx_r = __pyx_v_result;
10116  goto __pyx_L0;
10117 
10118  /* "View.MemoryView":244
10119  *
10120  * @cname("__pyx_array_new")
10121  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10122  * char *mode, char *buf):
10123  * cdef array result
10124  */
10125 
10126  /* function exit code */
10127  __pyx_L1_error:;
10128  __Pyx_XDECREF(__pyx_t_2);
10129  __Pyx_XDECREF(__pyx_t_3);
10130  __Pyx_XDECREF(__pyx_t_4);
10131  __Pyx_XDECREF(__pyx_t_5);
10132  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
10133  __pyx_r = 0;
10134  __pyx_L0:;
10135  __Pyx_XDECREF((PyObject *)__pyx_v_result);
10136  __Pyx_XGIVEREF((PyObject *)__pyx_r);
10137  __Pyx_RefNannyFinishContext();
10138  return __pyx_r;
10139 }
10140 
10141 /* "View.MemoryView":281
10142  * cdef class Enum(object):
10143  * cdef object name
10144  * def __init__(self, name): # <<<<<<<<<<<<<<
10145  * self.name = name
10146  * def __repr__(self):
10147  */
10148 
10149 /* Python wrapper */
10150 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10151 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10152  PyObject *__pyx_v_name = 0;
10153  int __pyx_lineno = 0;
10154  const char *__pyx_filename = NULL;
10155  int __pyx_clineno = 0;
10156  int __pyx_r;
10157  __Pyx_RefNannyDeclarations
10158  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
10159  {
10160  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
10161  PyObject* values[1] = {0};
10162  if (unlikely(__pyx_kwds)) {
10163  Py_ssize_t kw_args;
10164  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10165  switch (pos_args) {
10166  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10167  CYTHON_FALLTHROUGH;
10168  case 0: break;
10169  default: goto __pyx_L5_argtuple_error;
10170  }
10171  kw_args = PyDict_Size(__pyx_kwds);
10172  switch (pos_args) {
10173  case 0:
10174  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10175  else goto __pyx_L5_argtuple_error;
10176  }
10177  if (unlikely(kw_args > 0)) {
10178  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 281, __pyx_L3_error)
10179  }
10180  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10181  goto __pyx_L5_argtuple_error;
10182  } else {
10183  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10184  }
10185  __pyx_v_name = values[0];
10186  }
10187  goto __pyx_L4_argument_unpacking_done;
10188  __pyx_L5_argtuple_error:;
10189  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 281, __pyx_L3_error)
10190  __pyx_L3_error:;
10191  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10192  __Pyx_RefNannyFinishContext();
10193  return -1;
10194  __pyx_L4_argument_unpacking_done:;
10195  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10196 
10197  /* function exit code */
10198  __Pyx_RefNannyFinishContext();
10199  return __pyx_r;
10200 }
10201 
10202 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10203  int __pyx_r;
10204  __Pyx_RefNannyDeclarations
10205  __Pyx_RefNannySetupContext("__init__", 0);
10206 
10207  /* "View.MemoryView":282
10208  * cdef object name
10209  * def __init__(self, name):
10210  * self.name = name # <<<<<<<<<<<<<<
10211  * def __repr__(self):
10212  * return self.name
10213  */
10214  __Pyx_INCREF(__pyx_v_name);
10215  __Pyx_GIVEREF(__pyx_v_name);
10216  __Pyx_GOTREF(__pyx_v_self->name);
10217  __Pyx_DECREF(__pyx_v_self->name);
10218  __pyx_v_self->name = __pyx_v_name;
10219 
10220  /* "View.MemoryView":281
10221  * cdef class Enum(object):
10222  * cdef object name
10223  * def __init__(self, name): # <<<<<<<<<<<<<<
10224  * self.name = name
10225  * def __repr__(self):
10226  */
10227 
10228  /* function exit code */
10229  __pyx_r = 0;
10230  __Pyx_RefNannyFinishContext();
10231  return __pyx_r;
10232 }
10233 
10234 /* "View.MemoryView":283
10235  * def __init__(self, name):
10236  * self.name = name
10237  * def __repr__(self): # <<<<<<<<<<<<<<
10238  * return self.name
10239  *
10240  */
10241 
10242 /* Python wrapper */
10243 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
10244 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10245  PyObject *__pyx_r = 0;
10246  __Pyx_RefNannyDeclarations
10247  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
10248  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10249 
10250  /* function exit code */
10251  __Pyx_RefNannyFinishContext();
10252  return __pyx_r;
10253 }
10254 
10255 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10256  PyObject *__pyx_r = NULL;
10257  __Pyx_RefNannyDeclarations
10258  __Pyx_RefNannySetupContext("__repr__", 0);
10259 
10260  /* "View.MemoryView":284
10261  * self.name = name
10262  * def __repr__(self):
10263  * return self.name # <<<<<<<<<<<<<<
10264  *
10265  * cdef generic = Enum("<strided and direct or indirect>")
10266  */
10267  __Pyx_XDECREF(__pyx_r);
10268  __Pyx_INCREF(__pyx_v_self->name);
10269  __pyx_r = __pyx_v_self->name;
10270  goto __pyx_L0;
10271 
10272  /* "View.MemoryView":283
10273  * def __init__(self, name):
10274  * self.name = name
10275  * def __repr__(self): # <<<<<<<<<<<<<<
10276  * return self.name
10277  *
10278  */
10279 
10280  /* function exit code */
10281  __pyx_L0:;
10282  __Pyx_XGIVEREF(__pyx_r);
10283  __Pyx_RefNannyFinishContext();
10284  return __pyx_r;
10285 }
10286 
10287 /* "(tree fragment)":1
10288  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10289  * cdef tuple state
10290  * cdef object _dict
10291  */
10292 
10293 /* Python wrapper */
10294 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10295 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10296  PyObject *__pyx_r = 0;
10297  __Pyx_RefNannyDeclarations
10298  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10299  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10300 
10301  /* function exit code */
10302  __Pyx_RefNannyFinishContext();
10303  return __pyx_r;
10304 }
10305 
10306 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10307  PyObject *__pyx_v_state = 0;
10308  PyObject *__pyx_v__dict = 0;
10309  int __pyx_v_use_setstate;
10310  PyObject *__pyx_r = NULL;
10311  __Pyx_RefNannyDeclarations
10312  PyObject *__pyx_t_1 = NULL;
10313  int __pyx_t_2;
10314  int __pyx_t_3;
10315  PyObject *__pyx_t_4 = NULL;
10316  PyObject *__pyx_t_5 = NULL;
10317  int __pyx_lineno = 0;
10318  const char *__pyx_filename = NULL;
10319  int __pyx_clineno = 0;
10320  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10321 
10322  /* "(tree fragment)":5
10323  * cdef object _dict
10324  * cdef bint use_setstate
10325  * state = (self.name,) # <<<<<<<<<<<<<<
10326  * _dict = getattr(self, '__dict__', None)
10327  * if _dict is not None:
10328  */
10329  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
10330  __Pyx_GOTREF(__pyx_t_1);
10331  __Pyx_INCREF(__pyx_v_self->name);
10332  __Pyx_GIVEREF(__pyx_v_self->name);
10333  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10334  __pyx_v_state = ((PyObject*)__pyx_t_1);
10335  __pyx_t_1 = 0;
10336 
10337  /* "(tree fragment)":6
10338  * cdef bint use_setstate
10339  * state = (self.name,)
10340  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
10341  * if _dict is not None:
10342  * state += (_dict,)
10343  */
10344  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
10345  __Pyx_GOTREF(__pyx_t_1);
10346  __pyx_v__dict = __pyx_t_1;
10347  __pyx_t_1 = 0;
10348 
10349  /* "(tree fragment)":7
10350  * state = (self.name,)
10351  * _dict = getattr(self, '__dict__', None)
10352  * if _dict is not None: # <<<<<<<<<<<<<<
10353  * state += (_dict,)
10354  * use_setstate = True
10355  */
10356  __pyx_t_2 = (__pyx_v__dict != Py_None);
10357  __pyx_t_3 = (__pyx_t_2 != 0);
10358  if (__pyx_t_3) {
10359 
10360  /* "(tree fragment)":8
10361  * _dict = getattr(self, '__dict__', None)
10362  * if _dict is not None:
10363  * state += (_dict,) # <<<<<<<<<<<<<<
10364  * use_setstate = True
10365  * else:
10366  */
10367  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
10368  __Pyx_GOTREF(__pyx_t_1);
10369  __Pyx_INCREF(__pyx_v__dict);
10370  __Pyx_GIVEREF(__pyx_v__dict);
10371  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
10372  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
10373  __Pyx_GOTREF(__pyx_t_4);
10374  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10375  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
10376  __pyx_t_4 = 0;
10377 
10378  /* "(tree fragment)":9
10379  * if _dict is not None:
10380  * state += (_dict,)
10381  * use_setstate = True # <<<<<<<<<<<<<<
10382  * else:
10383  * use_setstate = self.name is not None
10384  */
10385  __pyx_v_use_setstate = 1;
10386 
10387  /* "(tree fragment)":7
10388  * state = (self.name,)
10389  * _dict = getattr(self, '__dict__', None)
10390  * if _dict is not None: # <<<<<<<<<<<<<<
10391  * state += (_dict,)
10392  * use_setstate = True
10393  */
10394  goto __pyx_L3;
10395  }
10396 
10397  /* "(tree fragment)":11
10398  * use_setstate = True
10399  * else:
10400  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
10401  * if use_setstate:
10402  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10403  */
10404  /*else*/ {
10405  __pyx_t_3 = (__pyx_v_self->name != Py_None);
10406  __pyx_v_use_setstate = __pyx_t_3;
10407  }
10408  __pyx_L3:;
10409 
10410  /* "(tree fragment)":12
10411  * else:
10412  * use_setstate = self.name is not None
10413  * if use_setstate: # <<<<<<<<<<<<<<
10414  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10415  * else:
10416  */
10417  __pyx_t_3 = (__pyx_v_use_setstate != 0);
10418  if (__pyx_t_3) {
10419 
10420  /* "(tree fragment)":13
10421  * use_setstate = self.name is not None
10422  * if use_setstate:
10423  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
10424  * else:
10425  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10426  */
10427  __Pyx_XDECREF(__pyx_r);
10428  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
10429  __Pyx_GOTREF(__pyx_t_4);
10430  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
10431  __Pyx_GOTREF(__pyx_t_1);
10432  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10433  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10434  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10435  __Pyx_INCREF(__pyx_int_184977713);
10436  __Pyx_GIVEREF(__pyx_int_184977713);
10437  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10438  __Pyx_INCREF(Py_None);
10439  __Pyx_GIVEREF(Py_None);
10440  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
10441  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
10442  __Pyx_GOTREF(__pyx_t_5);
10443  __Pyx_GIVEREF(__pyx_t_4);
10444  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10445  __Pyx_GIVEREF(__pyx_t_1);
10446  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
10447  __Pyx_INCREF(__pyx_v_state);
10448  __Pyx_GIVEREF(__pyx_v_state);
10449  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10450  __pyx_t_4 = 0;
10451  __pyx_t_1 = 0;
10452  __pyx_r = __pyx_t_5;
10453  __pyx_t_5 = 0;
10454  goto __pyx_L0;
10455 
10456  /* "(tree fragment)":12
10457  * else:
10458  * use_setstate = self.name is not None
10459  * if use_setstate: # <<<<<<<<<<<<<<
10460  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10461  * else:
10462  */
10463  }
10464 
10465  /* "(tree fragment)":15
10466  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10467  * else:
10468  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
10469  * def __setstate_cython__(self, __pyx_state):
10470  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10471  */
10472  /*else*/ {
10473  __Pyx_XDECREF(__pyx_r);
10474  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
10475  __Pyx_GOTREF(__pyx_t_5);
10476  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
10477  __Pyx_GOTREF(__pyx_t_1);
10478  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10479  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10480  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10481  __Pyx_INCREF(__pyx_int_184977713);
10482  __Pyx_GIVEREF(__pyx_int_184977713);
10483  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10484  __Pyx_INCREF(__pyx_v_state);
10485  __Pyx_GIVEREF(__pyx_v_state);
10486  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10487  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
10488  __Pyx_GOTREF(__pyx_t_4);
10489  __Pyx_GIVEREF(__pyx_t_5);
10490  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10491  __Pyx_GIVEREF(__pyx_t_1);
10492  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10493  __pyx_t_5 = 0;
10494  __pyx_t_1 = 0;
10495  __pyx_r = __pyx_t_4;
10496  __pyx_t_4 = 0;
10497  goto __pyx_L0;
10498  }
10499 
10500  /* "(tree fragment)":1
10501  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10502  * cdef tuple state
10503  * cdef object _dict
10504  */
10505 
10506  /* function exit code */
10507  __pyx_L1_error:;
10508  __Pyx_XDECREF(__pyx_t_1);
10509  __Pyx_XDECREF(__pyx_t_4);
10510  __Pyx_XDECREF(__pyx_t_5);
10511  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10512  __pyx_r = NULL;
10513  __pyx_L0:;
10514  __Pyx_XDECREF(__pyx_v_state);
10515  __Pyx_XDECREF(__pyx_v__dict);
10516  __Pyx_XGIVEREF(__pyx_r);
10517  __Pyx_RefNannyFinishContext();
10518  return __pyx_r;
10519 }
10520 
10521 /* "(tree fragment)":16
10522  * else:
10523  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10524  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10525  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10526  */
10527 
10528 /* Python wrapper */
10529 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10530 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10531  PyObject *__pyx_r = 0;
10532  __Pyx_RefNannyDeclarations
10533  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10534  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10535 
10536  /* function exit code */
10537  __Pyx_RefNannyFinishContext();
10538  return __pyx_r;
10539 }
10540 
10541 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10542  PyObject *__pyx_r = NULL;
10543  __Pyx_RefNannyDeclarations
10544  PyObject *__pyx_t_1 = NULL;
10545  int __pyx_lineno = 0;
10546  const char *__pyx_filename = NULL;
10547  int __pyx_clineno = 0;
10548  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10549 
10550  /* "(tree fragment)":17
10551  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10552  * def __setstate_cython__(self, __pyx_state):
10553  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
10554  */
10555  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
10556  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
10557  __Pyx_GOTREF(__pyx_t_1);
10558  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10559 
10560  /* "(tree fragment)":16
10561  * else:
10562  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10563  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10564  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10565  */
10566 
10567  /* function exit code */
10568  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10569  goto __pyx_L0;
10570  __pyx_L1_error:;
10571  __Pyx_XDECREF(__pyx_t_1);
10572  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10573  __pyx_r = NULL;
10574  __pyx_L0:;
10575  __Pyx_XGIVEREF(__pyx_r);
10576  __Pyx_RefNannyFinishContext();
10577  return __pyx_r;
10578 }
10579 
10580 /* "View.MemoryView":298
10581  *
10582  * @cname('__pyx_align_pointer')
10583  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10584  * "Align pointer memory on a given boundary"
10585  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10586  */
10587 
10588 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
10589  Py_intptr_t __pyx_v_aligned_p;
10590  size_t __pyx_v_offset;
10591  void *__pyx_r;
10592  int __pyx_t_1;
10593 
10594  /* "View.MemoryView":300
10595  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
10596  * "Align pointer memory on a given boundary"
10597  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
10598  * cdef size_t offset
10599  *
10600  */
10601  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10602 
10603  /* "View.MemoryView":304
10604  *
10605  * with cython.cdivision(True):
10606  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
10607  *
10608  * if offset > 0:
10609  */
10610  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10611 
10612  /* "View.MemoryView":306
10613  * offset = aligned_p % alignment
10614  *
10615  * if offset > 0: # <<<<<<<<<<<<<<
10616  * aligned_p += alignment - offset
10617  *
10618  */
10619  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10620  if (__pyx_t_1) {
10621 
10622  /* "View.MemoryView":307
10623  *
10624  * if offset > 0:
10625  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
10626  *
10627  * return <void *> aligned_p
10628  */
10629  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10630 
10631  /* "View.MemoryView":306
10632  * offset = aligned_p % alignment
10633  *
10634  * if offset > 0: # <<<<<<<<<<<<<<
10635  * aligned_p += alignment - offset
10636  *
10637  */
10638  }
10639 
10640  /* "View.MemoryView":309
10641  * aligned_p += alignment - offset
10642  *
10643  * return <void *> aligned_p # <<<<<<<<<<<<<<
10644  *
10645  *
10646  */
10647  __pyx_r = ((void *)__pyx_v_aligned_p);
10648  goto __pyx_L0;
10649 
10650  /* "View.MemoryView":298
10651  *
10652  * @cname('__pyx_align_pointer')
10653  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10654  * "Align pointer memory on a given boundary"
10655  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10656  */
10657 
10658  /* function exit code */
10659  __pyx_L0:;
10660  return __pyx_r;
10661 }
10662 
10663 /* "View.MemoryView":345
10664  * cdef __Pyx_TypeInfo *typeinfo
10665  *
10666  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10667  * self.obj = obj
10668  * self.flags = flags
10669  */
10670 
10671 /* Python wrapper */
10672 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10673 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10674  PyObject *__pyx_v_obj = 0;
10675  int __pyx_v_flags;
10676  int __pyx_v_dtype_is_object;
10677  int __pyx_lineno = 0;
10678  const char *__pyx_filename = NULL;
10679  int __pyx_clineno = 0;
10680  int __pyx_r;
10681  __Pyx_RefNannyDeclarations
10682  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
10683  {
10684  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10685  PyObject* values[3] = {0,0,0};
10686  if (unlikely(__pyx_kwds)) {
10687  Py_ssize_t kw_args;
10688  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10689  switch (pos_args) {
10690  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10691  CYTHON_FALLTHROUGH;
10692  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10693  CYTHON_FALLTHROUGH;
10694  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10695  CYTHON_FALLTHROUGH;
10696  case 0: break;
10697  default: goto __pyx_L5_argtuple_error;
10698  }
10699  kw_args = PyDict_Size(__pyx_kwds);
10700  switch (pos_args) {
10701  case 0:
10702  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10703  else goto __pyx_L5_argtuple_error;
10704  CYTHON_FALLTHROUGH;
10705  case 1:
10706  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10707  else {
10708  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 345, __pyx_L3_error)
10709  }
10710  CYTHON_FALLTHROUGH;
10711  case 2:
10712  if (kw_args > 0) {
10713  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10714  if (value) { values[2] = value; kw_args--; }
10715  }
10716  }
10717  if (unlikely(kw_args > 0)) {
10718  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 345, __pyx_L3_error)
10719  }
10720  } else {
10721  switch (PyTuple_GET_SIZE(__pyx_args)) {
10722  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10723  CYTHON_FALLTHROUGH;
10724  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10725  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10726  break;
10727  default: goto __pyx_L5_argtuple_error;
10728  }
10729  }
10730  __pyx_v_obj = values[0];
10731  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
10732  if (values[2]) {
10733  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
10734  } else {
10735  __pyx_v_dtype_is_object = ((int)0);
10736  }
10737  }
10738  goto __pyx_L4_argument_unpacking_done;
10739  __pyx_L5_argtuple_error:;
10740  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 345, __pyx_L3_error)
10741  __pyx_L3_error:;
10742  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10743  __Pyx_RefNannyFinishContext();
10744  return -1;
10745  __pyx_L4_argument_unpacking_done:;
10746  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
10747 
10748  /* function exit code */
10749  __Pyx_RefNannyFinishContext();
10750  return __pyx_r;
10751 }
10752 
10753 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
10754  int __pyx_r;
10755  __Pyx_RefNannyDeclarations
10756  int __pyx_t_1;
10757  int __pyx_t_2;
10758  int __pyx_t_3;
10759  int __pyx_t_4;
10760  int __pyx_lineno = 0;
10761  const char *__pyx_filename = NULL;
10762  int __pyx_clineno = 0;
10763  __Pyx_RefNannySetupContext("__cinit__", 0);
10764 
10765  /* "View.MemoryView":346
10766  *
10767  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10768  * self.obj = obj # <<<<<<<<<<<<<<
10769  * self.flags = flags
10770  * if type(self) is memoryview or obj is not None:
10771  */
10772  __Pyx_INCREF(__pyx_v_obj);
10773  __Pyx_GIVEREF(__pyx_v_obj);
10774  __Pyx_GOTREF(__pyx_v_self->obj);
10775  __Pyx_DECREF(__pyx_v_self->obj);
10776  __pyx_v_self->obj = __pyx_v_obj;
10777 
10778  /* "View.MemoryView":347
10779  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10780  * self.obj = obj
10781  * self.flags = flags # <<<<<<<<<<<<<<
10782  * if type(self) is memoryview or obj is not None:
10783  * __Pyx_GetBuffer(obj, &self.view, flags)
10784  */
10785  __pyx_v_self->flags = __pyx_v_flags;
10786 
10787  /* "View.MemoryView":348
10788  * self.obj = obj
10789  * self.flags = flags
10790  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10791  * __Pyx_GetBuffer(obj, &self.view, flags)
10792  * if <PyObject *> self.view.obj == NULL:
10793  */
10794  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10795  __pyx_t_3 = (__pyx_t_2 != 0);
10796  if (!__pyx_t_3) {
10797  } else {
10798  __pyx_t_1 = __pyx_t_3;
10799  goto __pyx_L4_bool_binop_done;
10800  }
10801  __pyx_t_3 = (__pyx_v_obj != Py_None);
10802  __pyx_t_2 = (__pyx_t_3 != 0);
10803  __pyx_t_1 = __pyx_t_2;
10804  __pyx_L4_bool_binop_done:;
10805  if (__pyx_t_1) {
10806 
10807  /* "View.MemoryView":349
10808  * self.flags = flags
10809  * if type(self) is memoryview or obj is not None:
10810  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
10811  * if <PyObject *> self.view.obj == NULL:
10812  * (<__pyx_buffer *> &self.view).obj = Py_None
10813  */
10814  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 349, __pyx_L1_error)
10815 
10816  /* "View.MemoryView":350
10817  * if type(self) is memoryview or obj is not None:
10818  * __Pyx_GetBuffer(obj, &self.view, flags)
10819  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10820  * (<__pyx_buffer *> &self.view).obj = Py_None
10821  * Py_INCREF(Py_None)
10822  */
10823  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10824  if (__pyx_t_1) {
10825 
10826  /* "View.MemoryView":351
10827  * __Pyx_GetBuffer(obj, &self.view, flags)
10828  * if <PyObject *> self.view.obj == NULL:
10829  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
10830  * Py_INCREF(Py_None)
10831  *
10832  */
10833  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10834 
10835  /* "View.MemoryView":352
10836  * if <PyObject *> self.view.obj == NULL:
10837  * (<__pyx_buffer *> &self.view).obj = Py_None
10838  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
10839  *
10840  * global __pyx_memoryview_thread_locks_used
10841  */
10842  Py_INCREF(Py_None);
10843 
10844  /* "View.MemoryView":350
10845  * if type(self) is memoryview or obj is not None:
10846  * __Pyx_GetBuffer(obj, &self.view, flags)
10847  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10848  * (<__pyx_buffer *> &self.view).obj = Py_None
10849  * Py_INCREF(Py_None)
10850  */
10851  }
10852 
10853  /* "View.MemoryView":348
10854  * self.obj = obj
10855  * self.flags = flags
10856  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10857  * __Pyx_GetBuffer(obj, &self.view, flags)
10858  * if <PyObject *> self.view.obj == NULL:
10859  */
10860  }
10861 
10862  /* "View.MemoryView":355
10863  *
10864  * global __pyx_memoryview_thread_locks_used
10865  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10866  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10867  * __pyx_memoryview_thread_locks_used += 1
10868  */
10869  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10870  if (__pyx_t_1) {
10871 
10872  /* "View.MemoryView":356
10873  * global __pyx_memoryview_thread_locks_used
10874  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10875  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
10876  * __pyx_memoryview_thread_locks_used += 1
10877  * if self.lock is NULL:
10878  */
10879  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10880 
10881  /* "View.MemoryView":357
10882  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10883  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10884  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
10885  * if self.lock is NULL:
10886  * self.lock = PyThread_allocate_lock()
10887  */
10888  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10889 
10890  /* "View.MemoryView":355
10891  *
10892  * global __pyx_memoryview_thread_locks_used
10893  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10894  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10895  * __pyx_memoryview_thread_locks_used += 1
10896  */
10897  }
10898 
10899  /* "View.MemoryView":358
10900  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10901  * __pyx_memoryview_thread_locks_used += 1
10902  * if self.lock is NULL: # <<<<<<<<<<<<<<
10903  * self.lock = PyThread_allocate_lock()
10904  * if self.lock is NULL:
10905  */
10906  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10907  if (__pyx_t_1) {
10908 
10909  /* "View.MemoryView":359
10910  * __pyx_memoryview_thread_locks_used += 1
10911  * if self.lock is NULL:
10912  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
10913  * if self.lock is NULL:
10914  * raise MemoryError
10915  */
10916  __pyx_v_self->lock = PyThread_allocate_lock();
10917 
10918  /* "View.MemoryView":360
10919  * if self.lock is NULL:
10920  * self.lock = PyThread_allocate_lock()
10921  * if self.lock is NULL: # <<<<<<<<<<<<<<
10922  * raise MemoryError
10923  *
10924  */
10925  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10926  if (unlikely(__pyx_t_1)) {
10927 
10928  /* "View.MemoryView":361
10929  * self.lock = PyThread_allocate_lock()
10930  * if self.lock is NULL:
10931  * raise MemoryError # <<<<<<<<<<<<<<
10932  *
10933  * if flags & PyBUF_FORMAT:
10934  */
10935  PyErr_NoMemory(); __PYX_ERR(2, 361, __pyx_L1_error)
10936 
10937  /* "View.MemoryView":360
10938  * if self.lock is NULL:
10939  * self.lock = PyThread_allocate_lock()
10940  * if self.lock is NULL: # <<<<<<<<<<<<<<
10941  * raise MemoryError
10942  *
10943  */
10944  }
10945 
10946  /* "View.MemoryView":358
10947  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10948  * __pyx_memoryview_thread_locks_used += 1
10949  * if self.lock is NULL: # <<<<<<<<<<<<<<
10950  * self.lock = PyThread_allocate_lock()
10951  * if self.lock is NULL:
10952  */
10953  }
10954 
10955  /* "View.MemoryView":363
10956  * raise MemoryError
10957  *
10958  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10959  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10960  * else:
10961  */
10962  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10963  if (__pyx_t_1) {
10964 
10965  /* "View.MemoryView":364
10966  *
10967  * if flags & PyBUF_FORMAT:
10968  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
10969  * else:
10970  * self.dtype_is_object = dtype_is_object
10971  */
10972  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
10973  if (__pyx_t_2) {
10974  } else {
10975  __pyx_t_1 = __pyx_t_2;
10976  goto __pyx_L11_bool_binop_done;
10977  }
10978  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
10979  __pyx_t_1 = __pyx_t_2;
10980  __pyx_L11_bool_binop_done:;
10981  __pyx_v_self->dtype_is_object = __pyx_t_1;
10982 
10983  /* "View.MemoryView":363
10984  * raise MemoryError
10985  *
10986  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10987  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10988  * else:
10989  */
10990  goto __pyx_L10;
10991  }
10992 
10993  /* "View.MemoryView":366
10994  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10995  * else:
10996  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
10997  *
10998  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10999  */
11000  /*else*/ {
11001  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
11002  }
11003  __pyx_L10:;
11004 
11005  /* "View.MemoryView":368
11006  * self.dtype_is_object = dtype_is_object
11007  *
11008  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
11009  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11010  * self.typeinfo = NULL
11011  */
11012  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
11013 
11014  /* "View.MemoryView":370
11015  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11016  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11017  * self.typeinfo = NULL # <<<<<<<<<<<<<<
11018  *
11019  * def __dealloc__(memoryview self):
11020  */
11021  __pyx_v_self->typeinfo = NULL;
11022 
11023  /* "View.MemoryView":345
11024  * cdef __Pyx_TypeInfo *typeinfo
11025  *
11026  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
11027  * self.obj = obj
11028  * self.flags = flags
11029  */
11030 
11031  /* function exit code */
11032  __pyx_r = 0;
11033  goto __pyx_L0;
11034  __pyx_L1_error:;
11035  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11036  __pyx_r = -1;
11037  __pyx_L0:;
11038  __Pyx_RefNannyFinishContext();
11039  return __pyx_r;
11040 }
11041 
11042 /* "View.MemoryView":372
11043  * self.typeinfo = NULL
11044  *
11045  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11046  * if self.obj is not None:
11047  * __Pyx_ReleaseBuffer(&self.view)
11048  */
11049 
11050 /* Python wrapper */
11051 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
11052 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
11053  __Pyx_RefNannyDeclarations
11054  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
11055  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11056 
11057  /* function exit code */
11058  __Pyx_RefNannyFinishContext();
11059 }
11060 
11061 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
11062  int __pyx_v_i;
11063  __Pyx_RefNannyDeclarations
11064  int __pyx_t_1;
11065  int __pyx_t_2;
11066  int __pyx_t_3;
11067  int __pyx_t_4;
11068  int __pyx_t_5;
11069  PyThread_type_lock __pyx_t_6;
11070  PyThread_type_lock __pyx_t_7;
11071  __Pyx_RefNannySetupContext("__dealloc__", 0);
11072 
11073  /* "View.MemoryView":373
11074  *
11075  * def __dealloc__(memoryview self):
11076  * if self.obj is not None: # <<<<<<<<<<<<<<
11077  * __Pyx_ReleaseBuffer(&self.view)
11078  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11079  */
11080  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
11081  __pyx_t_2 = (__pyx_t_1 != 0);
11082  if (__pyx_t_2) {
11083 
11084  /* "View.MemoryView":374
11085  * def __dealloc__(memoryview self):
11086  * if self.obj is not None:
11087  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
11088  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11089  *
11090  */
11091  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
11092 
11093  /* "View.MemoryView":373
11094  *
11095  * def __dealloc__(memoryview self):
11096  * if self.obj is not None: # <<<<<<<<<<<<<<
11097  * __Pyx_ReleaseBuffer(&self.view)
11098  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11099  */
11100  goto __pyx_L3;
11101  }
11102 
11103  /* "View.MemoryView":375
11104  * if self.obj is not None:
11105  * __Pyx_ReleaseBuffer(&self.view)
11106  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
11107  *
11108  * (<__pyx_buffer *> &self.view).obj = NULL
11109  */
11110  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
11111  if (__pyx_t_2) {
11112 
11113  /* "View.MemoryView":377
11114  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11115  *
11116  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
11117  * Py_DECREF(Py_None)
11118  *
11119  */
11120  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
11121 
11122  /* "View.MemoryView":378
11123  *
11124  * (<__pyx_buffer *> &self.view).obj = NULL
11125  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
11126  *
11127  * cdef int i
11128  */
11129  Py_DECREF(Py_None);
11130 
11131  /* "View.MemoryView":375
11132  * if self.obj is not None:
11133  * __Pyx_ReleaseBuffer(&self.view)
11134  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
11135  *
11136  * (<__pyx_buffer *> &self.view).obj = NULL
11137  */
11138  }
11139  __pyx_L3:;
11140 
11141  /* "View.MemoryView":382
11142  * cdef int i
11143  * global __pyx_memoryview_thread_locks_used
11144  * if self.lock != NULL: # <<<<<<<<<<<<<<
11145  * for i in range(__pyx_memoryview_thread_locks_used):
11146  * if __pyx_memoryview_thread_locks[i] is self.lock:
11147  */
11148  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
11149  if (__pyx_t_2) {
11150 
11151  /* "View.MemoryView":383
11152  * global __pyx_memoryview_thread_locks_used
11153  * if self.lock != NULL:
11154  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
11155  * if __pyx_memoryview_thread_locks[i] is self.lock:
11156  * __pyx_memoryview_thread_locks_used -= 1
11157  */
11158  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
11159  __pyx_t_4 = __pyx_t_3;
11160  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
11161  __pyx_v_i = __pyx_t_5;
11162 
11163  /* "View.MemoryView":384
11164  * if self.lock != NULL:
11165  * for i in range(__pyx_memoryview_thread_locks_used):
11166  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11167  * __pyx_memoryview_thread_locks_used -= 1
11168  * if i != __pyx_memoryview_thread_locks_used:
11169  */
11170  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
11171  if (__pyx_t_2) {
11172 
11173  /* "View.MemoryView":385
11174  * for i in range(__pyx_memoryview_thread_locks_used):
11175  * if __pyx_memoryview_thread_locks[i] is self.lock:
11176  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
11177  * if i != __pyx_memoryview_thread_locks_used:
11178  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11179  */
11180  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
11181 
11182  /* "View.MemoryView":386
11183  * if __pyx_memoryview_thread_locks[i] is self.lock:
11184  * __pyx_memoryview_thread_locks_used -= 1
11185  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11186  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11187  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11188  */
11189  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
11190  if (__pyx_t_2) {
11191 
11192  /* "View.MemoryView":388
11193  * if i != __pyx_memoryview_thread_locks_used:
11194  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11195  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
11196  * break
11197  * else:
11198  */
11199  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11200  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
11201 
11202  /* "View.MemoryView":387
11203  * __pyx_memoryview_thread_locks_used -= 1
11204  * if i != __pyx_memoryview_thread_locks_used:
11205  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
11206  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11207  * break
11208  */
11209  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
11210  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
11211 
11212  /* "View.MemoryView":386
11213  * if __pyx_memoryview_thread_locks[i] is self.lock:
11214  * __pyx_memoryview_thread_locks_used -= 1
11215  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11216  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11217  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11218  */
11219  }
11220 
11221  /* "View.MemoryView":389
11222  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11223  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11224  * break # <<<<<<<<<<<<<<
11225  * else:
11226  * PyThread_free_lock(self.lock)
11227  */
11228  goto __pyx_L6_break;
11229 
11230  /* "View.MemoryView":384
11231  * if self.lock != NULL:
11232  * for i in range(__pyx_memoryview_thread_locks_used):
11233  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11234  * __pyx_memoryview_thread_locks_used -= 1
11235  * if i != __pyx_memoryview_thread_locks_used:
11236  */
11237  }
11238  }
11239  /*else*/ {
11240 
11241  /* "View.MemoryView":391
11242  * break
11243  * else:
11244  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
11245  *
11246  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11247  */
11248  PyThread_free_lock(__pyx_v_self->lock);
11249  }
11250  __pyx_L6_break:;
11251 
11252  /* "View.MemoryView":382
11253  * cdef int i
11254  * global __pyx_memoryview_thread_locks_used
11255  * if self.lock != NULL: # <<<<<<<<<<<<<<
11256  * for i in range(__pyx_memoryview_thread_locks_used):
11257  * if __pyx_memoryview_thread_locks[i] is self.lock:
11258  */
11259  }
11260 
11261  /* "View.MemoryView":372
11262  * self.typeinfo = NULL
11263  *
11264  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11265  * if self.obj is not None:
11266  * __Pyx_ReleaseBuffer(&self.view)
11267  */
11268 
11269  /* function exit code */
11270  __Pyx_RefNannyFinishContext();
11271 }
11272 
11273 /* "View.MemoryView":393
11274  * PyThread_free_lock(self.lock)
11275  *
11276  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11277  * cdef Py_ssize_t dim
11278  * cdef char *itemp = <char *> self.view.buf
11279  */
11280 
11281 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11282  Py_ssize_t __pyx_v_dim;
11283  char *__pyx_v_itemp;
11284  PyObject *__pyx_v_idx = NULL;
11285  char *__pyx_r;
11286  __Pyx_RefNannyDeclarations
11287  Py_ssize_t __pyx_t_1;
11288  PyObject *__pyx_t_2 = NULL;
11289  Py_ssize_t __pyx_t_3;
11290  PyObject *(*__pyx_t_4)(PyObject *);
11291  PyObject *__pyx_t_5 = NULL;
11292  Py_ssize_t __pyx_t_6;
11293  char *__pyx_t_7;
11294  int __pyx_lineno = 0;
11295  const char *__pyx_filename = NULL;
11296  int __pyx_clineno = 0;
11297  __Pyx_RefNannySetupContext("get_item_pointer", 0);
11298 
11299  /* "View.MemoryView":395
11300  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11301  * cdef Py_ssize_t dim
11302  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
11303  *
11304  * for dim, idx in enumerate(index):
11305  */
11306  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
11307 
11308  /* "View.MemoryView":397
11309  * cdef char *itemp = <char *> self.view.buf
11310  *
11311  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11312  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11313  *
11314  */
11315  __pyx_t_1 = 0;
11316  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11317  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11318  __pyx_t_4 = NULL;
11319  } else {
11320  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 397, __pyx_L1_error)
11321  __Pyx_GOTREF(__pyx_t_2);
11322  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 397, __pyx_L1_error)
11323  }
11324  for (;;) {
11325  if (likely(!__pyx_t_4)) {
11326  if (likely(PyList_CheckExact(__pyx_t_2))) {
11327  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
11328  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11329  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error)
11330  #else
11331  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error)
11332  __Pyx_GOTREF(__pyx_t_5);
11333  #endif
11334  } else {
11335  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
11336  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11337  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error)
11338  #else
11339  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error)
11340  __Pyx_GOTREF(__pyx_t_5);
11341  #endif
11342  }
11343  } else {
11344  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11345  if (unlikely(!__pyx_t_5)) {
11346  PyObject* exc_type = PyErr_Occurred();
11347  if (exc_type) {
11348  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11349  else __PYX_ERR(2, 397, __pyx_L1_error)
11350  }
11351  break;
11352  }
11353  __Pyx_GOTREF(__pyx_t_5);
11354  }
11355  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11356  __pyx_t_5 = 0;
11357  __pyx_v_dim = __pyx_t_1;
11358  __pyx_t_1 = (__pyx_t_1 + 1);
11359 
11360  /* "View.MemoryView":398
11361  *
11362  * for dim, idx in enumerate(index):
11363  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
11364  *
11365  * return itemp
11366  */
11367  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 398, __pyx_L1_error)
11368  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 398, __pyx_L1_error)
11369  __pyx_v_itemp = __pyx_t_7;
11370 
11371  /* "View.MemoryView":397
11372  * cdef char *itemp = <char *> self.view.buf
11373  *
11374  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11375  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11376  *
11377  */
11378  }
11379  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11380 
11381  /* "View.MemoryView":400
11382  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11383  *
11384  * return itemp # <<<<<<<<<<<<<<
11385  *
11386  *
11387  */
11388  __pyx_r = __pyx_v_itemp;
11389  goto __pyx_L0;
11390 
11391  /* "View.MemoryView":393
11392  * PyThread_free_lock(self.lock)
11393  *
11394  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11395  * cdef Py_ssize_t dim
11396  * cdef char *itemp = <char *> self.view.buf
11397  */
11398 
11399  /* function exit code */
11400  __pyx_L1_error:;
11401  __Pyx_XDECREF(__pyx_t_2);
11402  __Pyx_XDECREF(__pyx_t_5);
11403  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11404  __pyx_r = NULL;
11405  __pyx_L0:;
11406  __Pyx_XDECREF(__pyx_v_idx);
11407  __Pyx_RefNannyFinishContext();
11408  return __pyx_r;
11409 }
11410 
11411 /* "View.MemoryView":403
11412  *
11413  *
11414  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11415  * if index is Ellipsis:
11416  * return self
11417  */
11418 
11419 /* Python wrapper */
11420 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
11421 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11422  PyObject *__pyx_r = 0;
11423  __Pyx_RefNannyDeclarations
11424  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
11425  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11426 
11427  /* function exit code */
11428  __Pyx_RefNannyFinishContext();
11429  return __pyx_r;
11430 }
11431 
11432 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11433  PyObject *__pyx_v_have_slices = NULL;
11434  PyObject *__pyx_v_indices = NULL;
11435  char *__pyx_v_itemp;
11436  PyObject *__pyx_r = NULL;
11437  __Pyx_RefNannyDeclarations
11438  int __pyx_t_1;
11439  int __pyx_t_2;
11440  PyObject *__pyx_t_3 = NULL;
11441  PyObject *__pyx_t_4 = NULL;
11442  PyObject *__pyx_t_5 = NULL;
11443  char *__pyx_t_6;
11444  int __pyx_lineno = 0;
11445  const char *__pyx_filename = NULL;
11446  int __pyx_clineno = 0;
11447  __Pyx_RefNannySetupContext("__getitem__", 0);
11448 
11449  /* "View.MemoryView":404
11450  *
11451  * def __getitem__(memoryview self, object index):
11452  * if index is Ellipsis: # <<<<<<<<<<<<<<
11453  * return self
11454  *
11455  */
11456  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
11457  __pyx_t_2 = (__pyx_t_1 != 0);
11458  if (__pyx_t_2) {
11459 
11460  /* "View.MemoryView":405
11461  * def __getitem__(memoryview self, object index):
11462  * if index is Ellipsis:
11463  * return self # <<<<<<<<<<<<<<
11464  *
11465  * have_slices, indices = _unellipsify(index, self.view.ndim)
11466  */
11467  __Pyx_XDECREF(__pyx_r);
11468  __Pyx_INCREF(((PyObject *)__pyx_v_self));
11469  __pyx_r = ((PyObject *)__pyx_v_self);
11470  goto __pyx_L0;
11471 
11472  /* "View.MemoryView":404
11473  *
11474  * def __getitem__(memoryview self, object index):
11475  * if index is Ellipsis: # <<<<<<<<<<<<<<
11476  * return self
11477  *
11478  */
11479  }
11480 
11481  /* "View.MemoryView":407
11482  * return self
11483  *
11484  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11485  *
11486  * cdef char *itemp
11487  */
11488  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 407, __pyx_L1_error)
11489  __Pyx_GOTREF(__pyx_t_3);
11490  if (likely(__pyx_t_3 != Py_None)) {
11491  PyObject* sequence = __pyx_t_3;
11492  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11493  if (unlikely(size != 2)) {
11494  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11495  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11496  __PYX_ERR(2, 407, __pyx_L1_error)
11497  }
11498  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11499  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
11500  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
11501  __Pyx_INCREF(__pyx_t_4);
11502  __Pyx_INCREF(__pyx_t_5);
11503  #else
11504  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 407, __pyx_L1_error)
11505  __Pyx_GOTREF(__pyx_t_4);
11506  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 407, __pyx_L1_error)
11507  __Pyx_GOTREF(__pyx_t_5);
11508  #endif
11509  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11510  } else {
11511  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 407, __pyx_L1_error)
11512  }
11513  __pyx_v_have_slices = __pyx_t_4;
11514  __pyx_t_4 = 0;
11515  __pyx_v_indices = __pyx_t_5;
11516  __pyx_t_5 = 0;
11517 
11518  /* "View.MemoryView":410
11519  *
11520  * cdef char *itemp
11521  * if have_slices: # <<<<<<<<<<<<<<
11522  * return memview_slice(self, indices)
11523  * else:
11524  */
11525  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 410, __pyx_L1_error)
11526  if (__pyx_t_2) {
11527 
11528  /* "View.MemoryView":411
11529  * cdef char *itemp
11530  * if have_slices:
11531  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
11532  * else:
11533  * itemp = self.get_item_pointer(indices)
11534  */
11535  __Pyx_XDECREF(__pyx_r);
11536  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 411, __pyx_L1_error)
11537  __Pyx_GOTREF(__pyx_t_3);
11538  __pyx_r = __pyx_t_3;
11539  __pyx_t_3 = 0;
11540  goto __pyx_L0;
11541 
11542  /* "View.MemoryView":410
11543  *
11544  * cdef char *itemp
11545  * if have_slices: # <<<<<<<<<<<<<<
11546  * return memview_slice(self, indices)
11547  * else:
11548  */
11549  }
11550 
11551  /* "View.MemoryView":413
11552  * return memview_slice(self, indices)
11553  * else:
11554  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
11555  * return self.convert_item_to_object(itemp)
11556  *
11557  */
11558  /*else*/ {
11559  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 413, __pyx_L1_error)
11560  __pyx_v_itemp = __pyx_t_6;
11561 
11562  /* "View.MemoryView":414
11563  * else:
11564  * itemp = self.get_item_pointer(indices)
11565  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
11566  *
11567  * def __setitem__(memoryview self, object index, object value):
11568  */
11569  __Pyx_XDECREF(__pyx_r);
11570  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error)
11571  __Pyx_GOTREF(__pyx_t_3);
11572  __pyx_r = __pyx_t_3;
11573  __pyx_t_3 = 0;
11574  goto __pyx_L0;
11575  }
11576 
11577  /* "View.MemoryView":403
11578  *
11579  *
11580  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11581  * if index is Ellipsis:
11582  * return self
11583  */
11584 
11585  /* function exit code */
11586  __pyx_L1_error:;
11587  __Pyx_XDECREF(__pyx_t_3);
11588  __Pyx_XDECREF(__pyx_t_4);
11589  __Pyx_XDECREF(__pyx_t_5);
11590  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11591  __pyx_r = NULL;
11592  __pyx_L0:;
11593  __Pyx_XDECREF(__pyx_v_have_slices);
11594  __Pyx_XDECREF(__pyx_v_indices);
11595  __Pyx_XGIVEREF(__pyx_r);
11596  __Pyx_RefNannyFinishContext();
11597  return __pyx_r;
11598 }
11599 
11600 /* "View.MemoryView":416
11601  * return self.convert_item_to_object(itemp)
11602  *
11603  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11604  * if self.view.readonly:
11605  * raise TypeError("Cannot assign to read-only memoryview")
11606  */
11607 
11608 /* Python wrapper */
11609 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
11610 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11611  int __pyx_r;
11612  __Pyx_RefNannyDeclarations
11613  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
11614  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
11615 
11616  /* function exit code */
11617  __Pyx_RefNannyFinishContext();
11618  return __pyx_r;
11619 }
11620 
11621 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11622  PyObject *__pyx_v_have_slices = NULL;
11623  PyObject *__pyx_v_obj = NULL;
11624  int __pyx_r;
11625  __Pyx_RefNannyDeclarations
11626  int __pyx_t_1;
11627  PyObject *__pyx_t_2 = NULL;
11628  PyObject *__pyx_t_3 = NULL;
11629  PyObject *__pyx_t_4 = NULL;
11630  int __pyx_lineno = 0;
11631  const char *__pyx_filename = NULL;
11632  int __pyx_clineno = 0;
11633  __Pyx_RefNannySetupContext("__setitem__", 0);
11634  __Pyx_INCREF(__pyx_v_index);
11635 
11636  /* "View.MemoryView":417
11637  *
11638  * def __setitem__(memoryview self, object index, object value):
11639  * if self.view.readonly: # <<<<<<<<<<<<<<
11640  * raise TypeError("Cannot assign to read-only memoryview")
11641  *
11642  */
11643  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11644  if (unlikely(__pyx_t_1)) {
11645 
11646  /* "View.MemoryView":418
11647  * def __setitem__(memoryview self, object index, object value):
11648  * if self.view.readonly:
11649  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
11650  *
11651  * have_slices, index = _unellipsify(index, self.view.ndim)
11652  */
11653  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error)
11654  __Pyx_GOTREF(__pyx_t_2);
11655  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11656  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11657  __PYX_ERR(2, 418, __pyx_L1_error)
11658 
11659  /* "View.MemoryView":417
11660  *
11661  * def __setitem__(memoryview self, object index, object value):
11662  * if self.view.readonly: # <<<<<<<<<<<<<<
11663  * raise TypeError("Cannot assign to read-only memoryview")
11664  *
11665  */
11666  }
11667 
11668  /* "View.MemoryView":420
11669  * raise TypeError("Cannot assign to read-only memoryview")
11670  *
11671  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11672  *
11673  * if have_slices:
11674  */
11675  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error)
11676  __Pyx_GOTREF(__pyx_t_2);
11677  if (likely(__pyx_t_2 != Py_None)) {
11678  PyObject* sequence = __pyx_t_2;
11679  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11680  if (unlikely(size != 2)) {
11681  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11682  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11683  __PYX_ERR(2, 420, __pyx_L1_error)
11684  }
11685  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11686  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11687  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11688  __Pyx_INCREF(__pyx_t_3);
11689  __Pyx_INCREF(__pyx_t_4);
11690  #else
11691  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 420, __pyx_L1_error)
11692  __Pyx_GOTREF(__pyx_t_3);
11693  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 420, __pyx_L1_error)
11694  __Pyx_GOTREF(__pyx_t_4);
11695  #endif
11696  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11697  } else {
11698  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 420, __pyx_L1_error)
11699  }
11700  __pyx_v_have_slices = __pyx_t_3;
11701  __pyx_t_3 = 0;
11702  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11703  __pyx_t_4 = 0;
11704 
11705  /* "View.MemoryView":422
11706  * have_slices, index = _unellipsify(index, self.view.ndim)
11707  *
11708  * if have_slices: # <<<<<<<<<<<<<<
11709  * obj = self.is_slice(value)
11710  * if obj:
11711  */
11712  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 422, __pyx_L1_error)
11713  if (__pyx_t_1) {
11714 
11715  /* "View.MemoryView":423
11716  *
11717  * if have_slices:
11718  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
11719  * if obj:
11720  * self.setitem_slice_assignment(self[index], obj)
11721  */
11722  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 423, __pyx_L1_error)
11723  __Pyx_GOTREF(__pyx_t_2);
11724  __pyx_v_obj = __pyx_t_2;
11725  __pyx_t_2 = 0;
11726 
11727  /* "View.MemoryView":424
11728  * if have_slices:
11729  * obj = self.is_slice(value)
11730  * if obj: # <<<<<<<<<<<<<<
11731  * self.setitem_slice_assignment(self[index], obj)
11732  * else:
11733  */
11734  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error)
11735  if (__pyx_t_1) {
11736 
11737  /* "View.MemoryView":425
11738  * obj = self.is_slice(value)
11739  * if obj:
11740  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
11741  * else:
11742  * self.setitem_slice_assign_scalar(self[index], value)
11743  */
11744  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error)
11745  __Pyx_GOTREF(__pyx_t_2);
11746  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 425, __pyx_L1_error)
11747  __Pyx_GOTREF(__pyx_t_4);
11748  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11749  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11750 
11751  /* "View.MemoryView":424
11752  * if have_slices:
11753  * obj = self.is_slice(value)
11754  * if obj: # <<<<<<<<<<<<<<
11755  * self.setitem_slice_assignment(self[index], obj)
11756  * else:
11757  */
11758  goto __pyx_L5;
11759  }
11760 
11761  /* "View.MemoryView":427
11762  * self.setitem_slice_assignment(self[index], obj)
11763  * else:
11764  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
11765  * else:
11766  * self.setitem_indexed(index, value)
11767  */
11768  /*else*/ {
11769  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __pyx_L1_error)
11770  __Pyx_GOTREF(__pyx_t_4);
11771  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 427, __pyx_L1_error)
11772  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 427, __pyx_L1_error)
11773  __Pyx_GOTREF(__pyx_t_2);
11774  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11775  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11776  }
11777  __pyx_L5:;
11778 
11779  /* "View.MemoryView":422
11780  * have_slices, index = _unellipsify(index, self.view.ndim)
11781  *
11782  * if have_slices: # <<<<<<<<<<<<<<
11783  * obj = self.is_slice(value)
11784  * if obj:
11785  */
11786  goto __pyx_L4;
11787  }
11788 
11789  /* "View.MemoryView":429
11790  * self.setitem_slice_assign_scalar(self[index], value)
11791  * else:
11792  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
11793  *
11794  * cdef is_slice(self, obj):
11795  */
11796  /*else*/ {
11797  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 429, __pyx_L1_error)
11798  __Pyx_GOTREF(__pyx_t_2);
11799  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11800  }
11801  __pyx_L4:;
11802 
11803  /* "View.MemoryView":416
11804  * return self.convert_item_to_object(itemp)
11805  *
11806  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11807  * if self.view.readonly:
11808  * raise TypeError("Cannot assign to read-only memoryview")
11809  */
11810 
11811  /* function exit code */
11812  __pyx_r = 0;
11813  goto __pyx_L0;
11814  __pyx_L1_error:;
11815  __Pyx_XDECREF(__pyx_t_2);
11816  __Pyx_XDECREF(__pyx_t_3);
11817  __Pyx_XDECREF(__pyx_t_4);
11818  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11819  __pyx_r = -1;
11820  __pyx_L0:;
11821  __Pyx_XDECREF(__pyx_v_have_slices);
11822  __Pyx_XDECREF(__pyx_v_obj);
11823  __Pyx_XDECREF(__pyx_v_index);
11824  __Pyx_RefNannyFinishContext();
11825  return __pyx_r;
11826 }
11827 
11828 /* "View.MemoryView":431
11829  * self.setitem_indexed(index, value)
11830  *
11831  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11832  * if not isinstance(obj, memoryview):
11833  * try:
11834  */
11835 
11836 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11837  PyObject *__pyx_r = NULL;
11838  __Pyx_RefNannyDeclarations
11839  int __pyx_t_1;
11840  int __pyx_t_2;
11841  PyObject *__pyx_t_3 = NULL;
11842  PyObject *__pyx_t_4 = NULL;
11843  PyObject *__pyx_t_5 = NULL;
11844  PyObject *__pyx_t_6 = NULL;
11845  PyObject *__pyx_t_7 = NULL;
11846  PyObject *__pyx_t_8 = NULL;
11847  int __pyx_t_9;
11848  int __pyx_lineno = 0;
11849  const char *__pyx_filename = NULL;
11850  int __pyx_clineno = 0;
11851  __Pyx_RefNannySetupContext("is_slice", 0);
11852  __Pyx_INCREF(__pyx_v_obj);
11853 
11854  /* "View.MemoryView":432
11855  *
11856  * cdef is_slice(self, obj):
11857  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11858  * try:
11859  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11860  */
11861  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11862  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11863  if (__pyx_t_2) {
11864 
11865  /* "View.MemoryView":433
11866  * cdef is_slice(self, obj):
11867  * if not isinstance(obj, memoryview):
11868  * try: # <<<<<<<<<<<<<<
11869  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11870  * self.dtype_is_object)
11871  */
11872  {
11873  __Pyx_PyThreadState_declare
11874  __Pyx_PyThreadState_assign
11875  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11876  __Pyx_XGOTREF(__pyx_t_3);
11877  __Pyx_XGOTREF(__pyx_t_4);
11878  __Pyx_XGOTREF(__pyx_t_5);
11879  /*try:*/ {
11880 
11881  /* "View.MemoryView":434
11882  * if not isinstance(obj, memoryview):
11883  * try:
11884  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11885  * self.dtype_is_object)
11886  * except TypeError:
11887  */
11888  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 434, __pyx_L4_error)
11889  __Pyx_GOTREF(__pyx_t_6);
11890 
11891  /* "View.MemoryView":435
11892  * try:
11893  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11894  * self.dtype_is_object) # <<<<<<<<<<<<<<
11895  * except TypeError:
11896  * return None
11897  */
11898  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 435, __pyx_L4_error)
11899  __Pyx_GOTREF(__pyx_t_7);
11900 
11901  /* "View.MemoryView":434
11902  * if not isinstance(obj, memoryview):
11903  * try:
11904  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11905  * self.dtype_is_object)
11906  * except TypeError:
11907  */
11908  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 434, __pyx_L4_error)
11909  __Pyx_GOTREF(__pyx_t_8);
11910  __Pyx_INCREF(__pyx_v_obj);
11911  __Pyx_GIVEREF(__pyx_v_obj);
11912  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11913  __Pyx_GIVEREF(__pyx_t_6);
11914  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11915  __Pyx_GIVEREF(__pyx_t_7);
11916  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11917  __pyx_t_6 = 0;
11918  __pyx_t_7 = 0;
11919  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 434, __pyx_L4_error)
11920  __Pyx_GOTREF(__pyx_t_7);
11921  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11922  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11923  __pyx_t_7 = 0;
11924 
11925  /* "View.MemoryView":433
11926  * cdef is_slice(self, obj):
11927  * if not isinstance(obj, memoryview):
11928  * try: # <<<<<<<<<<<<<<
11929  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11930  * self.dtype_is_object)
11931  */
11932  }
11933  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11934  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11935  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11936  goto __pyx_L9_try_end;
11937  __pyx_L4_error:;
11938  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11939  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11940  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11941 
11942  /* "View.MemoryView":436
11943  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11944  * self.dtype_is_object)
11945  * except TypeError: # <<<<<<<<<<<<<<
11946  * return None
11947  *
11948  */
11949  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11950  if (__pyx_t_9) {
11951  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11952  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 436, __pyx_L6_except_error)
11953  __Pyx_GOTREF(__pyx_t_7);
11954  __Pyx_GOTREF(__pyx_t_8);
11955  __Pyx_GOTREF(__pyx_t_6);
11956 
11957  /* "View.MemoryView":437
11958  * self.dtype_is_object)
11959  * except TypeError:
11960  * return None # <<<<<<<<<<<<<<
11961  *
11962  * return obj
11963  */
11964  __Pyx_XDECREF(__pyx_r);
11965  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11966  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11967  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11968  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11969  goto __pyx_L7_except_return;
11970  }
11971  goto __pyx_L6_except_error;
11972  __pyx_L6_except_error:;
11973 
11974  /* "View.MemoryView":433
11975  * cdef is_slice(self, obj):
11976  * if not isinstance(obj, memoryview):
11977  * try: # <<<<<<<<<<<<<<
11978  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11979  * self.dtype_is_object)
11980  */
11981  __Pyx_XGIVEREF(__pyx_t_3);
11982  __Pyx_XGIVEREF(__pyx_t_4);
11983  __Pyx_XGIVEREF(__pyx_t_5);
11984  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11985  goto __pyx_L1_error;
11986  __pyx_L7_except_return:;
11987  __Pyx_XGIVEREF(__pyx_t_3);
11988  __Pyx_XGIVEREF(__pyx_t_4);
11989  __Pyx_XGIVEREF(__pyx_t_5);
11990  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11991  goto __pyx_L0;
11992  __pyx_L9_try_end:;
11993  }
11994 
11995  /* "View.MemoryView":432
11996  *
11997  * cdef is_slice(self, obj):
11998  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11999  * try:
12000  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12001  */
12002  }
12003 
12004  /* "View.MemoryView":439
12005  * return None
12006  *
12007  * return obj # <<<<<<<<<<<<<<
12008  *
12009  * cdef setitem_slice_assignment(self, dst, src):
12010  */
12011  __Pyx_XDECREF(__pyx_r);
12012  __Pyx_INCREF(__pyx_v_obj);
12013  __pyx_r = __pyx_v_obj;
12014  goto __pyx_L0;
12015 
12016  /* "View.MemoryView":431
12017  * self.setitem_indexed(index, value)
12018  *
12019  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
12020  * if not isinstance(obj, memoryview):
12021  * try:
12022  */
12023 
12024  /* function exit code */
12025  __pyx_L1_error:;
12026  __Pyx_XDECREF(__pyx_t_6);
12027  __Pyx_XDECREF(__pyx_t_7);
12028  __Pyx_XDECREF(__pyx_t_8);
12029  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12030  __pyx_r = 0;
12031  __pyx_L0:;
12032  __Pyx_XDECREF(__pyx_v_obj);
12033  __Pyx_XGIVEREF(__pyx_r);
12034  __Pyx_RefNannyFinishContext();
12035  return __pyx_r;
12036 }
12037 
12038 /* "View.MemoryView":441
12039  * return obj
12040  *
12041  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12042  * cdef __Pyx_memviewslice dst_slice
12043  * cdef __Pyx_memviewslice src_slice
12044  */
12045 
12046 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
12047  __Pyx_memviewslice __pyx_v_dst_slice;
12048  __Pyx_memviewslice __pyx_v_src_slice;
12049  PyObject *__pyx_r = NULL;
12050  __Pyx_RefNannyDeclarations
12051  __Pyx_memviewslice *__pyx_t_1;
12052  __Pyx_memviewslice *__pyx_t_2;
12053  PyObject *__pyx_t_3 = NULL;
12054  int __pyx_t_4;
12055  int __pyx_t_5;
12056  int __pyx_t_6;
12057  int __pyx_lineno = 0;
12058  const char *__pyx_filename = NULL;
12059  int __pyx_clineno = 0;
12060  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
12061 
12062  /* "View.MemoryView":445
12063  * cdef __Pyx_memviewslice src_slice
12064  *
12065  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12066  * get_slice_from_memview(dst, &dst_slice)[0],
12067  * src.ndim, dst.ndim, self.dtype_is_object)
12068  */
12069  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 445, __pyx_L1_error)
12070  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 445, __pyx_L1_error)
12071 
12072  /* "View.MemoryView":446
12073  *
12074  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12075  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
12076  * src.ndim, dst.ndim, self.dtype_is_object)
12077  *
12078  */
12079  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 446, __pyx_L1_error)
12080  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 446, __pyx_L1_error)
12081 
12082  /* "View.MemoryView":447
12083  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12084  * get_slice_from_memview(dst, &dst_slice)[0],
12085  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
12086  *
12087  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12088  */
12089  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error)
12090  __Pyx_GOTREF(__pyx_t_3);
12091  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error)
12092  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12093  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error)
12094  __Pyx_GOTREF(__pyx_t_3);
12095  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error)
12096  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12097 
12098  /* "View.MemoryView":445
12099  * cdef __Pyx_memviewslice src_slice
12100  *
12101  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12102  * get_slice_from_memview(dst, &dst_slice)[0],
12103  * src.ndim, dst.ndim, self.dtype_is_object)
12104  */
12105  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 445, __pyx_L1_error)
12106 
12107  /* "View.MemoryView":441
12108  * return obj
12109  *
12110  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12111  * cdef __Pyx_memviewslice dst_slice
12112  * cdef __Pyx_memviewslice src_slice
12113  */
12114 
12115  /* function exit code */
12116  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12117  goto __pyx_L0;
12118  __pyx_L1_error:;
12119  __Pyx_XDECREF(__pyx_t_3);
12120  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
12121  __pyx_r = 0;
12122  __pyx_L0:;
12123  __Pyx_XGIVEREF(__pyx_r);
12124  __Pyx_RefNannyFinishContext();
12125  return __pyx_r;
12126 }
12127 
12128 /* "View.MemoryView":449
12129  * src.ndim, dst.ndim, self.dtype_is_object)
12130  *
12131  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12132  * cdef int array[128]
12133  * cdef void *tmp = NULL
12134  */
12135 
12136 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
12137  int __pyx_v_array[0x80];
12138  void *__pyx_v_tmp;
12139  void *__pyx_v_item;
12140  __Pyx_memviewslice *__pyx_v_dst_slice;
12141  __Pyx_memviewslice __pyx_v_tmp_slice;
12142  PyObject *__pyx_r = NULL;
12143  __Pyx_RefNannyDeclarations
12144  __Pyx_memviewslice *__pyx_t_1;
12145  int __pyx_t_2;
12146  PyObject *__pyx_t_3 = NULL;
12147  int __pyx_t_4;
12148  int __pyx_t_5;
12149  char const *__pyx_t_6;
12150  PyObject *__pyx_t_7 = NULL;
12151  PyObject *__pyx_t_8 = NULL;
12152  PyObject *__pyx_t_9 = NULL;
12153  PyObject *__pyx_t_10 = NULL;
12154  PyObject *__pyx_t_11 = NULL;
12155  PyObject *__pyx_t_12 = NULL;
12156  int __pyx_lineno = 0;
12157  const char *__pyx_filename = NULL;
12158  int __pyx_clineno = 0;
12159  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
12160 
12161  /* "View.MemoryView":451
12162  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12163  * cdef int array[128]
12164  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
12165  * cdef void *item
12166  *
12167  */
12168  __pyx_v_tmp = NULL;
12169 
12170  /* "View.MemoryView":456
12171  * cdef __Pyx_memviewslice *dst_slice
12172  * cdef __Pyx_memviewslice tmp_slice
12173  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
12174  *
12175  * if <size_t>self.view.itemsize > sizeof(array):
12176  */
12177  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 456, __pyx_L1_error)
12178  __pyx_v_dst_slice = __pyx_t_1;
12179 
12180  /* "View.MemoryView":458
12181  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12182  *
12183  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12184  * tmp = PyMem_Malloc(self.view.itemsize)
12185  * if tmp == NULL:
12186  */
12187  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
12188  if (__pyx_t_2) {
12189 
12190  /* "View.MemoryView":459
12191  *
12192  * if <size_t>self.view.itemsize > sizeof(array):
12193  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
12194  * if tmp == NULL:
12195  * raise MemoryError
12196  */
12197  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
12198 
12199  /* "View.MemoryView":460
12200  * if <size_t>self.view.itemsize > sizeof(array):
12201  * tmp = PyMem_Malloc(self.view.itemsize)
12202  * if tmp == NULL: # <<<<<<<<<<<<<<
12203  * raise MemoryError
12204  * item = tmp
12205  */
12206  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
12207  if (unlikely(__pyx_t_2)) {
12208 
12209  /* "View.MemoryView":461
12210  * tmp = PyMem_Malloc(self.view.itemsize)
12211  * if tmp == NULL:
12212  * raise MemoryError # <<<<<<<<<<<<<<
12213  * item = tmp
12214  * else:
12215  */
12216  PyErr_NoMemory(); __PYX_ERR(2, 461, __pyx_L1_error)
12217 
12218  /* "View.MemoryView":460
12219  * if <size_t>self.view.itemsize > sizeof(array):
12220  * tmp = PyMem_Malloc(self.view.itemsize)
12221  * if tmp == NULL: # <<<<<<<<<<<<<<
12222  * raise MemoryError
12223  * item = tmp
12224  */
12225  }
12226 
12227  /* "View.MemoryView":462
12228  * if tmp == NULL:
12229  * raise MemoryError
12230  * item = tmp # <<<<<<<<<<<<<<
12231  * else:
12232  * item = <void *> array
12233  */
12234  __pyx_v_item = __pyx_v_tmp;
12235 
12236  /* "View.MemoryView":458
12237  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12238  *
12239  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12240  * tmp = PyMem_Malloc(self.view.itemsize)
12241  * if tmp == NULL:
12242  */
12243  goto __pyx_L3;
12244  }
12245 
12246  /* "View.MemoryView":464
12247  * item = tmp
12248  * else:
12249  * item = <void *> array # <<<<<<<<<<<<<<
12250  *
12251  * try:
12252  */
12253  /*else*/ {
12254  __pyx_v_item = ((void *)__pyx_v_array);
12255  }
12256  __pyx_L3:;
12257 
12258  /* "View.MemoryView":466
12259  * item = <void *> array
12260  *
12261  * try: # <<<<<<<<<<<<<<
12262  * if self.dtype_is_object:
12263  * (<PyObject **> item)[0] = <PyObject *> value
12264  */
12265  /*try:*/ {
12266 
12267  /* "View.MemoryView":467
12268  *
12269  * try:
12270  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12271  * (<PyObject **> item)[0] = <PyObject *> value
12272  * else:
12273  */
12274  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
12275  if (__pyx_t_2) {
12276 
12277  /* "View.MemoryView":468
12278  * try:
12279  * if self.dtype_is_object:
12280  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
12281  * else:
12282  * self.assign_item_from_object(<char *> item, value)
12283  */
12284  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12285 
12286  /* "View.MemoryView":467
12287  *
12288  * try:
12289  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12290  * (<PyObject **> item)[0] = <PyObject *> value
12291  * else:
12292  */
12293  goto __pyx_L8;
12294  }
12295 
12296  /* "View.MemoryView":470
12297  * (<PyObject **> item)[0] = <PyObject *> value
12298  * else:
12299  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
12300  *
12301  *
12302  */
12303  /*else*/ {
12304  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 470, __pyx_L6_error)
12305  __Pyx_GOTREF(__pyx_t_3);
12306  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12307  }
12308  __pyx_L8:;
12309 
12310  /* "View.MemoryView":474
12311  *
12312  *
12313  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12314  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12315  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12316  */
12317  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12318  if (__pyx_t_2) {
12319 
12320  /* "View.MemoryView":475
12321  *
12322  * if self.view.suboffsets != NULL:
12323  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
12324  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12325  * item, self.dtype_is_object)
12326  */
12327  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 475, __pyx_L6_error)
12328  __Pyx_GOTREF(__pyx_t_3);
12329  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12330 
12331  /* "View.MemoryView":474
12332  *
12333  *
12334  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12335  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12336  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12337  */
12338  }
12339 
12340  /* "View.MemoryView":476
12341  * if self.view.suboffsets != NULL:
12342  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12343  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
12344  * item, self.dtype_is_object)
12345  * finally:
12346  */
12347  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
12348  }
12349 
12350  /* "View.MemoryView":479
12351  * item, self.dtype_is_object)
12352  * finally:
12353  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
12354  *
12355  * cdef setitem_indexed(self, index, value):
12356  */
12357  /*finally:*/ {
12358  /*normal exit:*/{
12359  PyMem_Free(__pyx_v_tmp);
12360  goto __pyx_L7;
12361  }
12362  __pyx_L6_error:;
12363  /*exception exit:*/{
12364  __Pyx_PyThreadState_declare
12365  __Pyx_PyThreadState_assign
12366  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12367  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12368  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
12369  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
12370  __Pyx_XGOTREF(__pyx_t_7);
12371  __Pyx_XGOTREF(__pyx_t_8);
12372  __Pyx_XGOTREF(__pyx_t_9);
12373  __Pyx_XGOTREF(__pyx_t_10);
12374  __Pyx_XGOTREF(__pyx_t_11);
12375  __Pyx_XGOTREF(__pyx_t_12);
12376  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
12377  {
12378  PyMem_Free(__pyx_v_tmp);
12379  }
12380  if (PY_MAJOR_VERSION >= 3) {
12381  __Pyx_XGIVEREF(__pyx_t_10);
12382  __Pyx_XGIVEREF(__pyx_t_11);
12383  __Pyx_XGIVEREF(__pyx_t_12);
12384  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
12385  }
12386  __Pyx_XGIVEREF(__pyx_t_7);
12387  __Pyx_XGIVEREF(__pyx_t_8);
12388  __Pyx_XGIVEREF(__pyx_t_9);
12389  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
12390  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12391  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
12392  goto __pyx_L1_error;
12393  }
12394  __pyx_L7:;
12395  }
12396 
12397  /* "View.MemoryView":449
12398  * src.ndim, dst.ndim, self.dtype_is_object)
12399  *
12400  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12401  * cdef int array[128]
12402  * cdef void *tmp = NULL
12403  */
12404 
12405  /* function exit code */
12406  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12407  goto __pyx_L0;
12408  __pyx_L1_error:;
12409  __Pyx_XDECREF(__pyx_t_3);
12410  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12411  __pyx_r = 0;
12412  __pyx_L0:;
12413  __Pyx_XGIVEREF(__pyx_r);
12414  __Pyx_RefNannyFinishContext();
12415  return __pyx_r;
12416 }
12417 
12418 /* "View.MemoryView":481
12419  * PyMem_Free(tmp)
12420  *
12421  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12422  * cdef char *itemp = self.get_item_pointer(index)
12423  * self.assign_item_from_object(itemp, value)
12424  */
12425 
12426 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12427  char *__pyx_v_itemp;
12428  PyObject *__pyx_r = NULL;
12429  __Pyx_RefNannyDeclarations
12430  char *__pyx_t_1;
12431  PyObject *__pyx_t_2 = NULL;
12432  int __pyx_lineno = 0;
12433  const char *__pyx_filename = NULL;
12434  int __pyx_clineno = 0;
12435  __Pyx_RefNannySetupContext("setitem_indexed", 0);
12436 
12437  /* "View.MemoryView":482
12438  *
12439  * cdef setitem_indexed(self, index, value):
12440  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
12441  * self.assign_item_from_object(itemp, value)
12442  *
12443  */
12444  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 482, __pyx_L1_error)
12445  __pyx_v_itemp = __pyx_t_1;
12446 
12447  /* "View.MemoryView":483
12448  * cdef setitem_indexed(self, index, value):
12449  * cdef char *itemp = self.get_item_pointer(index)
12450  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
12451  *
12452  * cdef convert_item_to_object(self, char *itemp):
12453  */
12454  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 483, __pyx_L1_error)
12455  __Pyx_GOTREF(__pyx_t_2);
12456  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12457 
12458  /* "View.MemoryView":481
12459  * PyMem_Free(tmp)
12460  *
12461  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12462  * cdef char *itemp = self.get_item_pointer(index)
12463  * self.assign_item_from_object(itemp, value)
12464  */
12465 
12466  /* function exit code */
12467  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12468  goto __pyx_L0;
12469  __pyx_L1_error:;
12470  __Pyx_XDECREF(__pyx_t_2);
12471  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
12472  __pyx_r = 0;
12473  __pyx_L0:;
12474  __Pyx_XGIVEREF(__pyx_r);
12475  __Pyx_RefNannyFinishContext();
12476  return __pyx_r;
12477 }
12478 
12479 /* "View.MemoryView":485
12480  * self.assign_item_from_object(itemp, value)
12481  *
12482  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12483  * """Only used if instantiated manually by the user, or if Cython doesn't
12484  * know how to convert the type"""
12485  */
12486 
12487 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
12488  PyObject *__pyx_v_struct = NULL;
12489  PyObject *__pyx_v_bytesitem = 0;
12490  PyObject *__pyx_v_result = NULL;
12491  PyObject *__pyx_r = NULL;
12492  __Pyx_RefNannyDeclarations
12493  PyObject *__pyx_t_1 = NULL;
12494  PyObject *__pyx_t_2 = NULL;
12495  PyObject *__pyx_t_3 = NULL;
12496  PyObject *__pyx_t_4 = NULL;
12497  PyObject *__pyx_t_5 = NULL;
12498  PyObject *__pyx_t_6 = NULL;
12499  PyObject *__pyx_t_7 = NULL;
12500  int __pyx_t_8;
12501  PyObject *__pyx_t_9 = NULL;
12502  size_t __pyx_t_10;
12503  int __pyx_t_11;
12504  int __pyx_lineno = 0;
12505  const char *__pyx_filename = NULL;
12506  int __pyx_clineno = 0;
12507  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
12508 
12509  /* "View.MemoryView":488
12510  * """Only used if instantiated manually by the user, or if Cython doesn't
12511  * know how to convert the type"""
12512  * import struct # <<<<<<<<<<<<<<
12513  * cdef bytes bytesitem
12514  *
12515  */
12516  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L1_error)
12517  __Pyx_GOTREF(__pyx_t_1);
12518  __pyx_v_struct = __pyx_t_1;
12519  __pyx_t_1 = 0;
12520 
12521  /* "View.MemoryView":491
12522  * cdef bytes bytesitem
12523  *
12524  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
12525  * try:
12526  * result = struct.unpack(self.view.format, bytesitem)
12527  */
12528  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 491, __pyx_L1_error)
12529  __Pyx_GOTREF(__pyx_t_1);
12530  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12531  __pyx_t_1 = 0;
12532 
12533  /* "View.MemoryView":492
12534  *
12535  * bytesitem = itemp[:self.view.itemsize]
12536  * try: # <<<<<<<<<<<<<<
12537  * result = struct.unpack(self.view.format, bytesitem)
12538  * except struct.error:
12539  */
12540  {
12541  __Pyx_PyThreadState_declare
12542  __Pyx_PyThreadState_assign
12543  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12544  __Pyx_XGOTREF(__pyx_t_2);
12545  __Pyx_XGOTREF(__pyx_t_3);
12546  __Pyx_XGOTREF(__pyx_t_4);
12547  /*try:*/ {
12548 
12549  /* "View.MemoryView":493
12550  * bytesitem = itemp[:self.view.itemsize]
12551  * try:
12552  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
12553  * except struct.error:
12554  * raise ValueError("Unable to convert item to object")
12555  */
12556  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 493, __pyx_L3_error)
12557  __Pyx_GOTREF(__pyx_t_5);
12558  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 493, __pyx_L3_error)
12559  __Pyx_GOTREF(__pyx_t_6);
12560  __pyx_t_7 = NULL;
12561  __pyx_t_8 = 0;
12562  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12563  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12564  if (likely(__pyx_t_7)) {
12565  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
12566  __Pyx_INCREF(__pyx_t_7);
12567  __Pyx_INCREF(function);
12568  __Pyx_DECREF_SET(__pyx_t_5, function);
12569  __pyx_t_8 = 1;
12570  }
12571  }
12572  #if CYTHON_FAST_PYCALL
12573  if (PyFunction_Check(__pyx_t_5)) {
12574  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12575  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
12576  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12577  __Pyx_GOTREF(__pyx_t_1);
12578  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12579  } else
12580  #endif
12581  #if CYTHON_FAST_PYCCALL
12582  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12583  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12584  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
12585  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12586  __Pyx_GOTREF(__pyx_t_1);
12587  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12588  } else
12589  #endif
12590  {
12591  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 493, __pyx_L3_error)
12592  __Pyx_GOTREF(__pyx_t_9);
12593  if (__pyx_t_7) {
12594  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12595  }
12596  __Pyx_GIVEREF(__pyx_t_6);
12597  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12598  __Pyx_INCREF(__pyx_v_bytesitem);
12599  __Pyx_GIVEREF(__pyx_v_bytesitem);
12600  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12601  __pyx_t_6 = 0;
12602  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
12603  __Pyx_GOTREF(__pyx_t_1);
12604  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12605  }
12606  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12607  __pyx_v_result = __pyx_t_1;
12608  __pyx_t_1 = 0;
12609 
12610  /* "View.MemoryView":492
12611  *
12612  * bytesitem = itemp[:self.view.itemsize]
12613  * try: # <<<<<<<<<<<<<<
12614  * result = struct.unpack(self.view.format, bytesitem)
12615  * except struct.error:
12616  */
12617  }
12618 
12619  /* "View.MemoryView":497
12620  * raise ValueError("Unable to convert item to object")
12621  * else:
12622  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12623  * return result[0]
12624  * return result
12625  */
12626  /*else:*/ {
12627  __pyx_t_10 = strlen(__pyx_v_self->view.format);
12628  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12629  if (__pyx_t_11) {
12630 
12631  /* "View.MemoryView":498
12632  * else:
12633  * if len(self.view.format) == 1:
12634  * return result[0] # <<<<<<<<<<<<<<
12635  * return result
12636  *
12637  */
12638  __Pyx_XDECREF(__pyx_r);
12639  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 498, __pyx_L5_except_error)
12640  __Pyx_GOTREF(__pyx_t_1);
12641  __pyx_r = __pyx_t_1;
12642  __pyx_t_1 = 0;
12643  goto __pyx_L6_except_return;
12644 
12645  /* "View.MemoryView":497
12646  * raise ValueError("Unable to convert item to object")
12647  * else:
12648  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12649  * return result[0]
12650  * return result
12651  */
12652  }
12653 
12654  /* "View.MemoryView":499
12655  * if len(self.view.format) == 1:
12656  * return result[0]
12657  * return result # <<<<<<<<<<<<<<
12658  *
12659  * cdef assign_item_from_object(self, char *itemp, object value):
12660  */
12661  __Pyx_XDECREF(__pyx_r);
12662  __Pyx_INCREF(__pyx_v_result);
12663  __pyx_r = __pyx_v_result;
12664  goto __pyx_L6_except_return;
12665  }
12666  __pyx_L3_error:;
12667  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12668  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12669  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12670  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12671  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12672 
12673  /* "View.MemoryView":494
12674  * try:
12675  * result = struct.unpack(self.view.format, bytesitem)
12676  * except struct.error: # <<<<<<<<<<<<<<
12677  * raise ValueError("Unable to convert item to object")
12678  * else:
12679  */
12680  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12681  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 494, __pyx_L5_except_error)
12682  __Pyx_GOTREF(__pyx_t_6);
12683  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12684  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12685  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12686  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12687  if (__pyx_t_8) {
12688  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12689  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 494, __pyx_L5_except_error)
12690  __Pyx_GOTREF(__pyx_t_9);
12691  __Pyx_GOTREF(__pyx_t_5);
12692  __Pyx_GOTREF(__pyx_t_1);
12693 
12694  /* "View.MemoryView":495
12695  * result = struct.unpack(self.view.format, bytesitem)
12696  * except struct.error:
12697  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
12698  * else:
12699  * if len(self.view.format) == 1:
12700  */
12701  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L5_except_error)
12702  __Pyx_GOTREF(__pyx_t_6);
12703  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12704  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12705  __PYX_ERR(2, 495, __pyx_L5_except_error)
12706  }
12707  goto __pyx_L5_except_error;
12708  __pyx_L5_except_error:;
12709 
12710  /* "View.MemoryView":492
12711  *
12712  * bytesitem = itemp[:self.view.itemsize]
12713  * try: # <<<<<<<<<<<<<<
12714  * result = struct.unpack(self.view.format, bytesitem)
12715  * except struct.error:
12716  */
12717  __Pyx_XGIVEREF(__pyx_t_2);
12718  __Pyx_XGIVEREF(__pyx_t_3);
12719  __Pyx_XGIVEREF(__pyx_t_4);
12720  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12721  goto __pyx_L1_error;
12722  __pyx_L6_except_return:;
12723  __Pyx_XGIVEREF(__pyx_t_2);
12724  __Pyx_XGIVEREF(__pyx_t_3);
12725  __Pyx_XGIVEREF(__pyx_t_4);
12726  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12727  goto __pyx_L0;
12728  }
12729 
12730  /* "View.MemoryView":485
12731  * self.assign_item_from_object(itemp, value)
12732  *
12733  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12734  * """Only used if instantiated manually by the user, or if Cython doesn't
12735  * know how to convert the type"""
12736  */
12737 
12738  /* function exit code */
12739  __pyx_L1_error:;
12740  __Pyx_XDECREF(__pyx_t_1);
12741  __Pyx_XDECREF(__pyx_t_5);
12742  __Pyx_XDECREF(__pyx_t_6);
12743  __Pyx_XDECREF(__pyx_t_7);
12744  __Pyx_XDECREF(__pyx_t_9);
12745  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12746  __pyx_r = 0;
12747  __pyx_L0:;
12748  __Pyx_XDECREF(__pyx_v_struct);
12749  __Pyx_XDECREF(__pyx_v_bytesitem);
12750  __Pyx_XDECREF(__pyx_v_result);
12751  __Pyx_XGIVEREF(__pyx_r);
12752  __Pyx_RefNannyFinishContext();
12753  return __pyx_r;
12754 }
12755 
12756 /* "View.MemoryView":501
12757  * return result
12758  *
12759  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12760  * """Only used if instantiated manually by the user, or if Cython doesn't
12761  * know how to convert the type"""
12762  */
12763 
12764 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12765  PyObject *__pyx_v_struct = NULL;
12766  char __pyx_v_c;
12767  PyObject *__pyx_v_bytesvalue = 0;
12768  Py_ssize_t __pyx_v_i;
12769  PyObject *__pyx_r = NULL;
12770  __Pyx_RefNannyDeclarations
12771  PyObject *__pyx_t_1 = NULL;
12772  int __pyx_t_2;
12773  int __pyx_t_3;
12774  PyObject *__pyx_t_4 = NULL;
12775  PyObject *__pyx_t_5 = NULL;
12776  PyObject *__pyx_t_6 = NULL;
12777  int __pyx_t_7;
12778  PyObject *__pyx_t_8 = NULL;
12779  Py_ssize_t __pyx_t_9;
12780  PyObject *__pyx_t_10 = NULL;
12781  char *__pyx_t_11;
12782  char *__pyx_t_12;
12783  char *__pyx_t_13;
12784  char *__pyx_t_14;
12785  int __pyx_lineno = 0;
12786  const char *__pyx_filename = NULL;
12787  int __pyx_clineno = 0;
12788  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
12789 
12790  /* "View.MemoryView":504
12791  * """Only used if instantiated manually by the user, or if Cython doesn't
12792  * know how to convert the type"""
12793  * import struct # <<<<<<<<<<<<<<
12794  * cdef char c
12795  * cdef bytes bytesvalue
12796  */
12797  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 504, __pyx_L1_error)
12798  __Pyx_GOTREF(__pyx_t_1);
12799  __pyx_v_struct = __pyx_t_1;
12800  __pyx_t_1 = 0;
12801 
12802  /* "View.MemoryView":509
12803  * cdef Py_ssize_t i
12804  *
12805  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12806  * bytesvalue = struct.pack(self.view.format, *value)
12807  * else:
12808  */
12809  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12810  __pyx_t_3 = (__pyx_t_2 != 0);
12811  if (__pyx_t_3) {
12812 
12813  /* "View.MemoryView":510
12814  *
12815  * if isinstance(value, tuple):
12816  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
12817  * else:
12818  * bytesvalue = struct.pack(self.view.format, value)
12819  */
12820  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 510, __pyx_L1_error)
12821  __Pyx_GOTREF(__pyx_t_1);
12822  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
12823  __Pyx_GOTREF(__pyx_t_4);
12824  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 510, __pyx_L1_error)
12825  __Pyx_GOTREF(__pyx_t_5);
12826  __Pyx_GIVEREF(__pyx_t_4);
12827  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12828  __pyx_t_4 = 0;
12829  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
12830  __Pyx_GOTREF(__pyx_t_4);
12831  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 510, __pyx_L1_error)
12832  __Pyx_GOTREF(__pyx_t_6);
12833  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12834  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12835  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
12836  __Pyx_GOTREF(__pyx_t_4);
12837  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12838  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12839  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 510, __pyx_L1_error)
12840  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12841  __pyx_t_4 = 0;
12842 
12843  /* "View.MemoryView":509
12844  * cdef Py_ssize_t i
12845  *
12846  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12847  * bytesvalue = struct.pack(self.view.format, *value)
12848  * else:
12849  */
12850  goto __pyx_L3;
12851  }
12852 
12853  /* "View.MemoryView":512
12854  * bytesvalue = struct.pack(self.view.format, *value)
12855  * else:
12856  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
12857  *
12858  * for i, c in enumerate(bytesvalue):
12859  */
12860  /*else*/ {
12861  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __pyx_L1_error)
12862  __Pyx_GOTREF(__pyx_t_6);
12863  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error)
12864  __Pyx_GOTREF(__pyx_t_1);
12865  __pyx_t_5 = NULL;
12866  __pyx_t_7 = 0;
12867  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12868  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12869  if (likely(__pyx_t_5)) {
12870  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
12871  __Pyx_INCREF(__pyx_t_5);
12872  __Pyx_INCREF(function);
12873  __Pyx_DECREF_SET(__pyx_t_6, function);
12874  __pyx_t_7 = 1;
12875  }
12876  }
12877  #if CYTHON_FAST_PYCALL
12878  if (PyFunction_Check(__pyx_t_6)) {
12879  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12880  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
12881  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12882  __Pyx_GOTREF(__pyx_t_4);
12883  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12884  } else
12885  #endif
12886  #if CYTHON_FAST_PYCCALL
12887  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12888  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12889  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
12890  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12891  __Pyx_GOTREF(__pyx_t_4);
12892  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12893  } else
12894  #endif
12895  {
12896  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 512, __pyx_L1_error)
12897  __Pyx_GOTREF(__pyx_t_8);
12898  if (__pyx_t_5) {
12899  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12900  }
12901  __Pyx_GIVEREF(__pyx_t_1);
12902  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12903  __Pyx_INCREF(__pyx_v_value);
12904  __Pyx_GIVEREF(__pyx_v_value);
12905  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12906  __pyx_t_1 = 0;
12907  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
12908  __Pyx_GOTREF(__pyx_t_4);
12909  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12910  }
12911  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12912  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 512, __pyx_L1_error)
12913  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12914  __pyx_t_4 = 0;
12915  }
12916  __pyx_L3:;
12917 
12918  /* "View.MemoryView":514
12919  * bytesvalue = struct.pack(self.view.format, value)
12920  *
12921  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12922  * itemp[i] = c
12923  *
12924  */
12925  __pyx_t_9 = 0;
12926  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12927  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
12928  __PYX_ERR(2, 514, __pyx_L1_error)
12929  }
12930  __Pyx_INCREF(__pyx_v_bytesvalue);
12931  __pyx_t_10 = __pyx_v_bytesvalue;
12932  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12933  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12934  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12935  __pyx_t_11 = __pyx_t_14;
12936  __pyx_v_c = (__pyx_t_11[0]);
12937 
12938  /* "View.MemoryView":515
12939  *
12940  * for i, c in enumerate(bytesvalue):
12941  * itemp[i] = c # <<<<<<<<<<<<<<
12942  *
12943  * @cname('getbuffer')
12944  */
12945  __pyx_v_i = __pyx_t_9;
12946 
12947  /* "View.MemoryView":514
12948  * bytesvalue = struct.pack(self.view.format, value)
12949  *
12950  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12951  * itemp[i] = c
12952  *
12953  */
12954  __pyx_t_9 = (__pyx_t_9 + 1);
12955 
12956  /* "View.MemoryView":515
12957  *
12958  * for i, c in enumerate(bytesvalue):
12959  * itemp[i] = c # <<<<<<<<<<<<<<
12960  *
12961  * @cname('getbuffer')
12962  */
12963  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12964  }
12965  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12966 
12967  /* "View.MemoryView":501
12968  * return result
12969  *
12970  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12971  * """Only used if instantiated manually by the user, or if Cython doesn't
12972  * know how to convert the type"""
12973  */
12974 
12975  /* function exit code */
12976  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12977  goto __pyx_L0;
12978  __pyx_L1_error:;
12979  __Pyx_XDECREF(__pyx_t_1);
12980  __Pyx_XDECREF(__pyx_t_4);
12981  __Pyx_XDECREF(__pyx_t_5);
12982  __Pyx_XDECREF(__pyx_t_6);
12983  __Pyx_XDECREF(__pyx_t_8);
12984  __Pyx_XDECREF(__pyx_t_10);
12985  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12986  __pyx_r = 0;
12987  __pyx_L0:;
12988  __Pyx_XDECREF(__pyx_v_struct);
12989  __Pyx_XDECREF(__pyx_v_bytesvalue);
12990  __Pyx_XGIVEREF(__pyx_r);
12991  __Pyx_RefNannyFinishContext();
12992  return __pyx_r;
12993 }
12994 
12995 /* "View.MemoryView":518
12996  *
12997  * @cname('getbuffer')
12998  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12999  * if flags & PyBUF_WRITABLE and self.view.readonly:
13000  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13001  */
13002 
13003 /* Python wrapper */
13004 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
13005 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13006  int __pyx_r;
13007  __Pyx_RefNannyDeclarations
13008  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
13009  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
13010 
13011  /* function exit code */
13012  __Pyx_RefNannyFinishContext();
13013  return __pyx_r;
13014 }
13015 
13016 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13017  int __pyx_r;
13018  __Pyx_RefNannyDeclarations
13019  int __pyx_t_1;
13020  int __pyx_t_2;
13021  PyObject *__pyx_t_3 = NULL;
13022  Py_ssize_t *__pyx_t_4;
13023  char *__pyx_t_5;
13024  void *__pyx_t_6;
13025  int __pyx_t_7;
13026  Py_ssize_t __pyx_t_8;
13027  int __pyx_lineno = 0;
13028  const char *__pyx_filename = NULL;
13029  int __pyx_clineno = 0;
13030  if (__pyx_v_info == NULL) {
13031  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
13032  return -1;
13033  }
13034  __Pyx_RefNannySetupContext("__getbuffer__", 0);
13035  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13036  __Pyx_GIVEREF(__pyx_v_info->obj);
13037 
13038  /* "View.MemoryView":519
13039  * @cname('getbuffer')
13040  * def __getbuffer__(self, Py_buffer *info, int flags):
13041  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13042  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13043  *
13044  */
13045  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
13046  if (__pyx_t_2) {
13047  } else {
13048  __pyx_t_1 = __pyx_t_2;
13049  goto __pyx_L4_bool_binop_done;
13050  }
13051  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
13052  __pyx_t_1 = __pyx_t_2;
13053  __pyx_L4_bool_binop_done:;
13054  if (unlikely(__pyx_t_1)) {
13055 
13056  /* "View.MemoryView":520
13057  * def __getbuffer__(self, Py_buffer *info, int flags):
13058  * if flags & PyBUF_WRITABLE and self.view.readonly:
13059  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
13060  *
13061  * if flags & PyBUF_ND:
13062  */
13063  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 520, __pyx_L1_error)
13064  __Pyx_GOTREF(__pyx_t_3);
13065  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13066  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13067  __PYX_ERR(2, 520, __pyx_L1_error)
13068 
13069  /* "View.MemoryView":519
13070  * @cname('getbuffer')
13071  * def __getbuffer__(self, Py_buffer *info, int flags):
13072  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13073  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13074  *
13075  */
13076  }
13077 
13078  /* "View.MemoryView":522
13079  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13080  *
13081  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
13082  * info.shape = self.view.shape
13083  * else:
13084  */
13085  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
13086  if (__pyx_t_1) {
13087 
13088  /* "View.MemoryView":523
13089  *
13090  * if flags & PyBUF_ND:
13091  * info.shape = self.view.shape # <<<<<<<<<<<<<<
13092  * else:
13093  * info.shape = NULL
13094  */
13095  __pyx_t_4 = __pyx_v_self->view.shape;
13096  __pyx_v_info->shape = __pyx_t_4;
13097 
13098  /* "View.MemoryView":522
13099  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13100  *
13101  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
13102  * info.shape = self.view.shape
13103  * else:
13104  */
13105  goto __pyx_L6;
13106  }
13107 
13108  /* "View.MemoryView":525
13109  * info.shape = self.view.shape
13110  * else:
13111  * info.shape = NULL # <<<<<<<<<<<<<<
13112  *
13113  * if flags & PyBUF_STRIDES:
13114  */
13115  /*else*/ {
13116  __pyx_v_info->shape = NULL;
13117  }
13118  __pyx_L6:;
13119 
13120  /* "View.MemoryView":527
13121  * info.shape = NULL
13122  *
13123  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13124  * info.strides = self.view.strides
13125  * else:
13126  */
13127  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13128  if (__pyx_t_1) {
13129 
13130  /* "View.MemoryView":528
13131  *
13132  * if flags & PyBUF_STRIDES:
13133  * info.strides = self.view.strides # <<<<<<<<<<<<<<
13134  * else:
13135  * info.strides = NULL
13136  */
13137  __pyx_t_4 = __pyx_v_self->view.strides;
13138  __pyx_v_info->strides = __pyx_t_4;
13139 
13140  /* "View.MemoryView":527
13141  * info.shape = NULL
13142  *
13143  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13144  * info.strides = self.view.strides
13145  * else:
13146  */
13147  goto __pyx_L7;
13148  }
13149 
13150  /* "View.MemoryView":530
13151  * info.strides = self.view.strides
13152  * else:
13153  * info.strides = NULL # <<<<<<<<<<<<<<
13154  *
13155  * if flags & PyBUF_INDIRECT:
13156  */
13157  /*else*/ {
13158  __pyx_v_info->strides = NULL;
13159  }
13160  __pyx_L7:;
13161 
13162  /* "View.MemoryView":532
13163  * info.strides = NULL
13164  *
13165  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13166  * info.suboffsets = self.view.suboffsets
13167  * else:
13168  */
13169  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13170  if (__pyx_t_1) {
13171 
13172  /* "View.MemoryView":533
13173  *
13174  * if flags & PyBUF_INDIRECT:
13175  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
13176  * else:
13177  * info.suboffsets = NULL
13178  */
13179  __pyx_t_4 = __pyx_v_self->view.suboffsets;
13180  __pyx_v_info->suboffsets = __pyx_t_4;
13181 
13182  /* "View.MemoryView":532
13183  * info.strides = NULL
13184  *
13185  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13186  * info.suboffsets = self.view.suboffsets
13187  * else:
13188  */
13189  goto __pyx_L8;
13190  }
13191 
13192  /* "View.MemoryView":535
13193  * info.suboffsets = self.view.suboffsets
13194  * else:
13195  * info.suboffsets = NULL # <<<<<<<<<<<<<<
13196  *
13197  * if flags & PyBUF_FORMAT:
13198  */
13199  /*else*/ {
13200  __pyx_v_info->suboffsets = NULL;
13201  }
13202  __pyx_L8:;
13203 
13204  /* "View.MemoryView":537
13205  * info.suboffsets = NULL
13206  *
13207  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13208  * info.format = self.view.format
13209  * else:
13210  */
13211  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
13212  if (__pyx_t_1) {
13213 
13214  /* "View.MemoryView":538
13215  *
13216  * if flags & PyBUF_FORMAT:
13217  * info.format = self.view.format # <<<<<<<<<<<<<<
13218  * else:
13219  * info.format = NULL
13220  */
13221  __pyx_t_5 = __pyx_v_self->view.format;
13222  __pyx_v_info->format = __pyx_t_5;
13223 
13224  /* "View.MemoryView":537
13225  * info.suboffsets = NULL
13226  *
13227  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13228  * info.format = self.view.format
13229  * else:
13230  */
13231  goto __pyx_L9;
13232  }
13233 
13234  /* "View.MemoryView":540
13235  * info.format = self.view.format
13236  * else:
13237  * info.format = NULL # <<<<<<<<<<<<<<
13238  *
13239  * info.buf = self.view.buf
13240  */
13241  /*else*/ {
13242  __pyx_v_info->format = NULL;
13243  }
13244  __pyx_L9:;
13245 
13246  /* "View.MemoryView":542
13247  * info.format = NULL
13248  *
13249  * info.buf = self.view.buf # <<<<<<<<<<<<<<
13250  * info.ndim = self.view.ndim
13251  * info.itemsize = self.view.itemsize
13252  */
13253  __pyx_t_6 = __pyx_v_self->view.buf;
13254  __pyx_v_info->buf = __pyx_t_6;
13255 
13256  /* "View.MemoryView":543
13257  *
13258  * info.buf = self.view.buf
13259  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
13260  * info.itemsize = self.view.itemsize
13261  * info.len = self.view.len
13262  */
13263  __pyx_t_7 = __pyx_v_self->view.ndim;
13264  __pyx_v_info->ndim = __pyx_t_7;
13265 
13266  /* "View.MemoryView":544
13267  * info.buf = self.view.buf
13268  * info.ndim = self.view.ndim
13269  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
13270  * info.len = self.view.len
13271  * info.readonly = self.view.readonly
13272  */
13273  __pyx_t_8 = __pyx_v_self->view.itemsize;
13274  __pyx_v_info->itemsize = __pyx_t_8;
13275 
13276  /* "View.MemoryView":545
13277  * info.ndim = self.view.ndim
13278  * info.itemsize = self.view.itemsize
13279  * info.len = self.view.len # <<<<<<<<<<<<<<
13280  * info.readonly = self.view.readonly
13281  * info.obj = self
13282  */
13283  __pyx_t_8 = __pyx_v_self->view.len;
13284  __pyx_v_info->len = __pyx_t_8;
13285 
13286  /* "View.MemoryView":546
13287  * info.itemsize = self.view.itemsize
13288  * info.len = self.view.len
13289  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
13290  * info.obj = self
13291  *
13292  */
13293  __pyx_t_1 = __pyx_v_self->view.readonly;
13294  __pyx_v_info->readonly = __pyx_t_1;
13295 
13296  /* "View.MemoryView":547
13297  * info.len = self.view.len
13298  * info.readonly = self.view.readonly
13299  * info.obj = self # <<<<<<<<<<<<<<
13300  *
13301  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
13302  */
13303  __Pyx_INCREF(((PyObject *)__pyx_v_self));
13304  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13305  __Pyx_GOTREF(__pyx_v_info->obj);
13306  __Pyx_DECREF(__pyx_v_info->obj);
13307  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13308 
13309  /* "View.MemoryView":518
13310  *
13311  * @cname('getbuffer')
13312  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13313  * if flags & PyBUF_WRITABLE and self.view.readonly:
13314  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13315  */
13316 
13317  /* function exit code */
13318  __pyx_r = 0;
13319  goto __pyx_L0;
13320  __pyx_L1_error:;
13321  __Pyx_XDECREF(__pyx_t_3);
13322  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13323  __pyx_r = -1;
13324  if (__pyx_v_info->obj != NULL) {
13325  __Pyx_GOTREF(__pyx_v_info->obj);
13326  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13327  }
13328  goto __pyx_L2;
13329  __pyx_L0:;
13330  if (__pyx_v_info->obj == Py_None) {
13331  __Pyx_GOTREF(__pyx_v_info->obj);
13332  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13333  }
13334  __pyx_L2:;
13335  __Pyx_RefNannyFinishContext();
13336  return __pyx_r;
13337 }
13338 
13339 /* "View.MemoryView":553
13340  *
13341  * @property
13342  * def T(self): # <<<<<<<<<<<<<<
13343  * cdef _memoryviewslice result = memoryview_copy(self)
13344  * transpose_memslice(&result.from_slice)
13345  */
13346 
13347 /* Python wrapper */
13348 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
13349 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13350  PyObject *__pyx_r = 0;
13351  __Pyx_RefNannyDeclarations
13352  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13353  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13354 
13355  /* function exit code */
13356  __Pyx_RefNannyFinishContext();
13357  return __pyx_r;
13358 }
13359 
13360 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13361  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13362  PyObject *__pyx_r = NULL;
13363  __Pyx_RefNannyDeclarations
13364  PyObject *__pyx_t_1 = NULL;
13365  int __pyx_t_2;
13366  int __pyx_lineno = 0;
13367  const char *__pyx_filename = NULL;
13368  int __pyx_clineno = 0;
13369  __Pyx_RefNannySetupContext("__get__", 0);
13370 
13371  /* "View.MemoryView":554
13372  * @property
13373  * def T(self):
13374  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
13375  * transpose_memslice(&result.from_slice)
13376  * return result
13377  */
13378  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 554, __pyx_L1_error)
13379  __Pyx_GOTREF(__pyx_t_1);
13380  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 554, __pyx_L1_error)
13381  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13382  __pyx_t_1 = 0;
13383 
13384  /* "View.MemoryView":555
13385  * def T(self):
13386  * cdef _memoryviewslice result = memoryview_copy(self)
13387  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
13388  * return result
13389  *
13390  */
13391  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 555, __pyx_L1_error)
13392 
13393  /* "View.MemoryView":556
13394  * cdef _memoryviewslice result = memoryview_copy(self)
13395  * transpose_memslice(&result.from_slice)
13396  * return result # <<<<<<<<<<<<<<
13397  *
13398  * @property
13399  */
13400  __Pyx_XDECREF(__pyx_r);
13401  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13402  __pyx_r = ((PyObject *)__pyx_v_result);
13403  goto __pyx_L0;
13404 
13405  /* "View.MemoryView":553
13406  *
13407  * @property
13408  * def T(self): # <<<<<<<<<<<<<<
13409  * cdef _memoryviewslice result = memoryview_copy(self)
13410  * transpose_memslice(&result.from_slice)
13411  */
13412 
13413  /* function exit code */
13414  __pyx_L1_error:;
13415  __Pyx_XDECREF(__pyx_t_1);
13416  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13417  __pyx_r = NULL;
13418  __pyx_L0:;
13419  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13420  __Pyx_XGIVEREF(__pyx_r);
13421  __Pyx_RefNannyFinishContext();
13422  return __pyx_r;
13423 }
13424 
13425 /* "View.MemoryView":559
13426  *
13427  * @property
13428  * def base(self): # <<<<<<<<<<<<<<
13429  * return self.obj
13430  *
13431  */
13432 
13433 /* Python wrapper */
13434 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
13435 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13436  PyObject *__pyx_r = 0;
13437  __Pyx_RefNannyDeclarations
13438  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13439  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13440 
13441  /* function exit code */
13442  __Pyx_RefNannyFinishContext();
13443  return __pyx_r;
13444 }
13445 
13446 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13447  PyObject *__pyx_r = NULL;
13448  __Pyx_RefNannyDeclarations
13449  __Pyx_RefNannySetupContext("__get__", 0);
13450 
13451  /* "View.MemoryView":560
13452  * @property
13453  * def base(self):
13454  * return self.obj # <<<<<<<<<<<<<<
13455  *
13456  * @property
13457  */
13458  __Pyx_XDECREF(__pyx_r);
13459  __Pyx_INCREF(__pyx_v_self->obj);
13460  __pyx_r = __pyx_v_self->obj;
13461  goto __pyx_L0;
13462 
13463  /* "View.MemoryView":559
13464  *
13465  * @property
13466  * def base(self): # <<<<<<<<<<<<<<
13467  * return self.obj
13468  *
13469  */
13470 
13471  /* function exit code */
13472  __pyx_L0:;
13473  __Pyx_XGIVEREF(__pyx_r);
13474  __Pyx_RefNannyFinishContext();
13475  return __pyx_r;
13476 }
13477 
13478 /* "View.MemoryView":563
13479  *
13480  * @property
13481  * def shape(self): # <<<<<<<<<<<<<<
13482  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13483  *
13484  */
13485 
13486 /* Python wrapper */
13487 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
13488 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13489  PyObject *__pyx_r = 0;
13490  __Pyx_RefNannyDeclarations
13491  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13492  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13493 
13494  /* function exit code */
13495  __Pyx_RefNannyFinishContext();
13496  return __pyx_r;
13497 }
13498 
13499 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13500  Py_ssize_t __pyx_v_length;
13501  PyObject *__pyx_r = NULL;
13502  __Pyx_RefNannyDeclarations
13503  PyObject *__pyx_t_1 = NULL;
13504  Py_ssize_t *__pyx_t_2;
13505  Py_ssize_t *__pyx_t_3;
13506  Py_ssize_t *__pyx_t_4;
13507  PyObject *__pyx_t_5 = NULL;
13508  int __pyx_lineno = 0;
13509  const char *__pyx_filename = NULL;
13510  int __pyx_clineno = 0;
13511  __Pyx_RefNannySetupContext("__get__", 0);
13512 
13513  /* "View.MemoryView":564
13514  * @property
13515  * def shape(self):
13516  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
13517  *
13518  * @property
13519  */
13520  __Pyx_XDECREF(__pyx_r);
13521  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 564, __pyx_L1_error)
13522  __Pyx_GOTREF(__pyx_t_1);
13523  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13524  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13525  __pyx_t_2 = __pyx_t_4;
13526  __pyx_v_length = (__pyx_t_2[0]);
13527  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error)
13528  __Pyx_GOTREF(__pyx_t_5);
13529  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 564, __pyx_L1_error)
13530  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13531  }
13532  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error)
13533  __Pyx_GOTREF(__pyx_t_5);
13534  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13535  __pyx_r = __pyx_t_5;
13536  __pyx_t_5 = 0;
13537  goto __pyx_L0;
13538 
13539  /* "View.MemoryView":563
13540  *
13541  * @property
13542  * def shape(self): # <<<<<<<<<<<<<<
13543  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13544  *
13545  */
13546 
13547  /* function exit code */
13548  __pyx_L1_error:;
13549  __Pyx_XDECREF(__pyx_t_1);
13550  __Pyx_XDECREF(__pyx_t_5);
13551  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13552  __pyx_r = NULL;
13553  __pyx_L0:;
13554  __Pyx_XGIVEREF(__pyx_r);
13555  __Pyx_RefNannyFinishContext();
13556  return __pyx_r;
13557 }
13558 
13559 /* "View.MemoryView":567
13560  *
13561  * @property
13562  * def strides(self): # <<<<<<<<<<<<<<
13563  * if self.view.strides == NULL:
13564  *
13565  */
13566 
13567 /* Python wrapper */
13568 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
13569 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13570  PyObject *__pyx_r = 0;
13571  __Pyx_RefNannyDeclarations
13572  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13573  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13574 
13575  /* function exit code */
13576  __Pyx_RefNannyFinishContext();
13577  return __pyx_r;
13578 }
13579 
13580 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13581  Py_ssize_t __pyx_v_stride;
13582  PyObject *__pyx_r = NULL;
13583  __Pyx_RefNannyDeclarations
13584  int __pyx_t_1;
13585  PyObject *__pyx_t_2 = NULL;
13586  Py_ssize_t *__pyx_t_3;
13587  Py_ssize_t *__pyx_t_4;
13588  Py_ssize_t *__pyx_t_5;
13589  PyObject *__pyx_t_6 = NULL;
13590  int __pyx_lineno = 0;
13591  const char *__pyx_filename = NULL;
13592  int __pyx_clineno = 0;
13593  __Pyx_RefNannySetupContext("__get__", 0);
13594 
13595  /* "View.MemoryView":568
13596  * @property
13597  * def strides(self):
13598  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13599  *
13600  * raise ValueError("Buffer view does not expose strides")
13601  */
13602  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13603  if (unlikely(__pyx_t_1)) {
13604 
13605  /* "View.MemoryView":570
13606  * if self.view.strides == NULL:
13607  *
13608  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
13609  *
13610  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
13611  */
13612  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 570, __pyx_L1_error)
13613  __Pyx_GOTREF(__pyx_t_2);
13614  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13615  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13616  __PYX_ERR(2, 570, __pyx_L1_error)
13617 
13618  /* "View.MemoryView":568
13619  * @property
13620  * def strides(self):
13621  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13622  *
13623  * raise ValueError("Buffer view does not expose strides")
13624  */
13625  }
13626 
13627  /* "View.MemoryView":572
13628  * raise ValueError("Buffer view does not expose strides")
13629  *
13630  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
13631  *
13632  * @property
13633  */
13634  __Pyx_XDECREF(__pyx_r);
13635  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error)
13636  __Pyx_GOTREF(__pyx_t_2);
13637  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13638  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13639  __pyx_t_3 = __pyx_t_5;
13640  __pyx_v_stride = (__pyx_t_3[0]);
13641  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error)
13642  __Pyx_GOTREF(__pyx_t_6);
13643  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 572, __pyx_L1_error)
13644  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13645  }
13646  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error)
13647  __Pyx_GOTREF(__pyx_t_6);
13648  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13649  __pyx_r = __pyx_t_6;
13650  __pyx_t_6 = 0;
13651  goto __pyx_L0;
13652 
13653  /* "View.MemoryView":567
13654  *
13655  * @property
13656  * def strides(self): # <<<<<<<<<<<<<<
13657  * if self.view.strides == NULL:
13658  *
13659  */
13660 
13661  /* function exit code */
13662  __pyx_L1_error:;
13663  __Pyx_XDECREF(__pyx_t_2);
13664  __Pyx_XDECREF(__pyx_t_6);
13665  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13666  __pyx_r = NULL;
13667  __pyx_L0:;
13668  __Pyx_XGIVEREF(__pyx_r);
13669  __Pyx_RefNannyFinishContext();
13670  return __pyx_r;
13671 }
13672 
13673 /* "View.MemoryView":575
13674  *
13675  * @property
13676  * def suboffsets(self): # <<<<<<<<<<<<<<
13677  * if self.view.suboffsets == NULL:
13678  * return (-1,) * self.view.ndim
13679  */
13680 
13681 /* Python wrapper */
13682 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
13683 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13684  PyObject *__pyx_r = 0;
13685  __Pyx_RefNannyDeclarations
13686  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13687  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13688 
13689  /* function exit code */
13690  __Pyx_RefNannyFinishContext();
13691  return __pyx_r;
13692 }
13693 
13694 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13695  Py_ssize_t __pyx_v_suboffset;
13696  PyObject *__pyx_r = NULL;
13697  __Pyx_RefNannyDeclarations
13698  int __pyx_t_1;
13699  PyObject *__pyx_t_2 = NULL;
13700  PyObject *__pyx_t_3 = NULL;
13701  Py_ssize_t *__pyx_t_4;
13702  Py_ssize_t *__pyx_t_5;
13703  Py_ssize_t *__pyx_t_6;
13704  int __pyx_lineno = 0;
13705  const char *__pyx_filename = NULL;
13706  int __pyx_clineno = 0;
13707  __Pyx_RefNannySetupContext("__get__", 0);
13708 
13709  /* "View.MemoryView":576
13710  * @property
13711  * def suboffsets(self):
13712  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13713  * return (-1,) * self.view.ndim
13714  *
13715  */
13716  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13717  if (__pyx_t_1) {
13718 
13719  /* "View.MemoryView":577
13720  * def suboffsets(self):
13721  * if self.view.suboffsets == NULL:
13722  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
13723  *
13724  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
13725  */
13726  __Pyx_XDECREF(__pyx_r);
13727  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error)
13728  __Pyx_GOTREF(__pyx_t_2);
13729  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__14, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error)
13730  __Pyx_GOTREF(__pyx_t_3);
13731  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13732  __pyx_r = __pyx_t_3;
13733  __pyx_t_3 = 0;
13734  goto __pyx_L0;
13735 
13736  /* "View.MemoryView":576
13737  * @property
13738  * def suboffsets(self):
13739  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13740  * return (-1,) * self.view.ndim
13741  *
13742  */
13743  }
13744 
13745  /* "View.MemoryView":579
13746  * return (-1,) * self.view.ndim
13747  *
13748  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
13749  *
13750  * @property
13751  */
13752  __Pyx_XDECREF(__pyx_r);
13753  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error)
13754  __Pyx_GOTREF(__pyx_t_3);
13755  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13756  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13757  __pyx_t_4 = __pyx_t_6;
13758  __pyx_v_suboffset = (__pyx_t_4[0]);
13759  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
13760  __Pyx_GOTREF(__pyx_t_2);
13761  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 579, __pyx_L1_error)
13762  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13763  }
13764  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
13765  __Pyx_GOTREF(__pyx_t_2);
13766  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13767  __pyx_r = __pyx_t_2;
13768  __pyx_t_2 = 0;
13769  goto __pyx_L0;
13770 
13771  /* "View.MemoryView":575
13772  *
13773  * @property
13774  * def suboffsets(self): # <<<<<<<<<<<<<<
13775  * if self.view.suboffsets == NULL:
13776  * return (-1,) * self.view.ndim
13777  */
13778 
13779  /* function exit code */
13780  __pyx_L1_error:;
13781  __Pyx_XDECREF(__pyx_t_2);
13782  __Pyx_XDECREF(__pyx_t_3);
13783  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13784  __pyx_r = NULL;
13785  __pyx_L0:;
13786  __Pyx_XGIVEREF(__pyx_r);
13787  __Pyx_RefNannyFinishContext();
13788  return __pyx_r;
13789 }
13790 
13791 /* "View.MemoryView":582
13792  *
13793  * @property
13794  * def ndim(self): # <<<<<<<<<<<<<<
13795  * return self.view.ndim
13796  *
13797  */
13798 
13799 /* Python wrapper */
13800 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
13801 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13802  PyObject *__pyx_r = 0;
13803  __Pyx_RefNannyDeclarations
13804  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13805  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13806 
13807  /* function exit code */
13808  __Pyx_RefNannyFinishContext();
13809  return __pyx_r;
13810 }
13811 
13812 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13813  PyObject *__pyx_r = NULL;
13814  __Pyx_RefNannyDeclarations
13815  PyObject *__pyx_t_1 = NULL;
13816  int __pyx_lineno = 0;
13817  const char *__pyx_filename = NULL;
13818  int __pyx_clineno = 0;
13819  __Pyx_RefNannySetupContext("__get__", 0);
13820 
13821  /* "View.MemoryView":583
13822  * @property
13823  * def ndim(self):
13824  * return self.view.ndim # <<<<<<<<<<<<<<
13825  *
13826  * @property
13827  */
13828  __Pyx_XDECREF(__pyx_r);
13829  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 583, __pyx_L1_error)
13830  __Pyx_GOTREF(__pyx_t_1);
13831  __pyx_r = __pyx_t_1;
13832  __pyx_t_1 = 0;
13833  goto __pyx_L0;
13834 
13835  /* "View.MemoryView":582
13836  *
13837  * @property
13838  * def ndim(self): # <<<<<<<<<<<<<<
13839  * return self.view.ndim
13840  *
13841  */
13842 
13843  /* function exit code */
13844  __pyx_L1_error:;
13845  __Pyx_XDECREF(__pyx_t_1);
13846  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13847  __pyx_r = NULL;
13848  __pyx_L0:;
13849  __Pyx_XGIVEREF(__pyx_r);
13850  __Pyx_RefNannyFinishContext();
13851  return __pyx_r;
13852 }
13853 
13854 /* "View.MemoryView":586
13855  *
13856  * @property
13857  * def itemsize(self): # <<<<<<<<<<<<<<
13858  * return self.view.itemsize
13859  *
13860  */
13861 
13862 /* Python wrapper */
13863 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
13864 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13865  PyObject *__pyx_r = 0;
13866  __Pyx_RefNannyDeclarations
13867  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13868  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13869 
13870  /* function exit code */
13871  __Pyx_RefNannyFinishContext();
13872  return __pyx_r;
13873 }
13874 
13875 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13876  PyObject *__pyx_r = NULL;
13877  __Pyx_RefNannyDeclarations
13878  PyObject *__pyx_t_1 = NULL;
13879  int __pyx_lineno = 0;
13880  const char *__pyx_filename = NULL;
13881  int __pyx_clineno = 0;
13882  __Pyx_RefNannySetupContext("__get__", 0);
13883 
13884  /* "View.MemoryView":587
13885  * @property
13886  * def itemsize(self):
13887  * return self.view.itemsize # <<<<<<<<<<<<<<
13888  *
13889  * @property
13890  */
13891  __Pyx_XDECREF(__pyx_r);
13892  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 587, __pyx_L1_error)
13893  __Pyx_GOTREF(__pyx_t_1);
13894  __pyx_r = __pyx_t_1;
13895  __pyx_t_1 = 0;
13896  goto __pyx_L0;
13897 
13898  /* "View.MemoryView":586
13899  *
13900  * @property
13901  * def itemsize(self): # <<<<<<<<<<<<<<
13902  * return self.view.itemsize
13903  *
13904  */
13905 
13906  /* function exit code */
13907  __pyx_L1_error:;
13908  __Pyx_XDECREF(__pyx_t_1);
13909  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13910  __pyx_r = NULL;
13911  __pyx_L0:;
13912  __Pyx_XGIVEREF(__pyx_r);
13913  __Pyx_RefNannyFinishContext();
13914  return __pyx_r;
13915 }
13916 
13917 /* "View.MemoryView":590
13918  *
13919  * @property
13920  * def nbytes(self): # <<<<<<<<<<<<<<
13921  * return self.size * self.view.itemsize
13922  *
13923  */
13924 
13925 /* Python wrapper */
13926 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
13927 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13928  PyObject *__pyx_r = 0;
13929  __Pyx_RefNannyDeclarations
13930  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13931  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13932 
13933  /* function exit code */
13934  __Pyx_RefNannyFinishContext();
13935  return __pyx_r;
13936 }
13937 
13938 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13939  PyObject *__pyx_r = NULL;
13940  __Pyx_RefNannyDeclarations
13941  PyObject *__pyx_t_1 = NULL;
13942  PyObject *__pyx_t_2 = NULL;
13943  PyObject *__pyx_t_3 = NULL;
13944  int __pyx_lineno = 0;
13945  const char *__pyx_filename = NULL;
13946  int __pyx_clineno = 0;
13947  __Pyx_RefNannySetupContext("__get__", 0);
13948 
13949  /* "View.MemoryView":591
13950  * @property
13951  * def nbytes(self):
13952  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
13953  *
13954  * @property
13955  */
13956  __Pyx_XDECREF(__pyx_r);
13957  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 591, __pyx_L1_error)
13958  __Pyx_GOTREF(__pyx_t_1);
13959  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 591, __pyx_L1_error)
13960  __Pyx_GOTREF(__pyx_t_2);
13961  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 591, __pyx_L1_error)
13962  __Pyx_GOTREF(__pyx_t_3);
13963  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13964  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13965  __pyx_r = __pyx_t_3;
13966  __pyx_t_3 = 0;
13967  goto __pyx_L0;
13968 
13969  /* "View.MemoryView":590
13970  *
13971  * @property
13972  * def nbytes(self): # <<<<<<<<<<<<<<
13973  * return self.size * self.view.itemsize
13974  *
13975  */
13976 
13977  /* function exit code */
13978  __pyx_L1_error:;
13979  __Pyx_XDECREF(__pyx_t_1);
13980  __Pyx_XDECREF(__pyx_t_2);
13981  __Pyx_XDECREF(__pyx_t_3);
13982  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13983  __pyx_r = NULL;
13984  __pyx_L0:;
13985  __Pyx_XGIVEREF(__pyx_r);
13986  __Pyx_RefNannyFinishContext();
13987  return __pyx_r;
13988 }
13989 
13990 /* "View.MemoryView":594
13991  *
13992  * @property
13993  * def size(self): # <<<<<<<<<<<<<<
13994  * if self._size is None:
13995  * result = 1
13996  */
13997 
13998 /* Python wrapper */
13999 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
14000 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
14001  PyObject *__pyx_r = 0;
14002  __Pyx_RefNannyDeclarations
14003  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14004  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14005 
14006  /* function exit code */
14007  __Pyx_RefNannyFinishContext();
14008  return __pyx_r;
14009 }
14010 
14011 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14012  PyObject *__pyx_v_result = NULL;
14013  PyObject *__pyx_v_length = NULL;
14014  PyObject *__pyx_r = NULL;
14015  __Pyx_RefNannyDeclarations
14016  int __pyx_t_1;
14017  int __pyx_t_2;
14018  Py_ssize_t *__pyx_t_3;
14019  Py_ssize_t *__pyx_t_4;
14020  Py_ssize_t *__pyx_t_5;
14021  PyObject *__pyx_t_6 = NULL;
14022  int __pyx_lineno = 0;
14023  const char *__pyx_filename = NULL;
14024  int __pyx_clineno = 0;
14025  __Pyx_RefNannySetupContext("__get__", 0);
14026 
14027  /* "View.MemoryView":595
14028  * @property
14029  * def size(self):
14030  * if self._size is None: # <<<<<<<<<<<<<<
14031  * result = 1
14032  *
14033  */
14034  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
14035  __pyx_t_2 = (__pyx_t_1 != 0);
14036  if (__pyx_t_2) {
14037 
14038  /* "View.MemoryView":596
14039  * def size(self):
14040  * if self._size is None:
14041  * result = 1 # <<<<<<<<<<<<<<
14042  *
14043  * for length in self.view.shape[:self.view.ndim]:
14044  */
14045  __Pyx_INCREF(__pyx_int_1);
14046  __pyx_v_result = __pyx_int_1;
14047 
14048  /* "View.MemoryView":598
14049  * result = 1
14050  *
14051  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
14052  * result *= length
14053  *
14054  */
14055  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14056  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14057  __pyx_t_3 = __pyx_t_5;
14058  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 598, __pyx_L1_error)
14059  __Pyx_GOTREF(__pyx_t_6);
14060  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
14061  __pyx_t_6 = 0;
14062 
14063  /* "View.MemoryView":599
14064  *
14065  * for length in self.view.shape[:self.view.ndim]:
14066  * result *= length # <<<<<<<<<<<<<<
14067  *
14068  * self._size = result
14069  */
14070  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 599, __pyx_L1_error)
14071  __Pyx_GOTREF(__pyx_t_6);
14072  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
14073  __pyx_t_6 = 0;
14074  }
14075 
14076  /* "View.MemoryView":601
14077  * result *= length
14078  *
14079  * self._size = result # <<<<<<<<<<<<<<
14080  *
14081  * return self._size
14082  */
14083  __Pyx_INCREF(__pyx_v_result);
14084  __Pyx_GIVEREF(__pyx_v_result);
14085  __Pyx_GOTREF(__pyx_v_self->_size);
14086  __Pyx_DECREF(__pyx_v_self->_size);
14087  __pyx_v_self->_size = __pyx_v_result;
14088 
14089  /* "View.MemoryView":595
14090  * @property
14091  * def size(self):
14092  * if self._size is None: # <<<<<<<<<<<<<<
14093  * result = 1
14094  *
14095  */
14096  }
14097 
14098  /* "View.MemoryView":603
14099  * self._size = result
14100  *
14101  * return self._size # <<<<<<<<<<<<<<
14102  *
14103  * def __len__(self):
14104  */
14105  __Pyx_XDECREF(__pyx_r);
14106  __Pyx_INCREF(__pyx_v_self->_size);
14107  __pyx_r = __pyx_v_self->_size;
14108  goto __pyx_L0;
14109 
14110  /* "View.MemoryView":594
14111  *
14112  * @property
14113  * def size(self): # <<<<<<<<<<<<<<
14114  * if self._size is None:
14115  * result = 1
14116  */
14117 
14118  /* function exit code */
14119  __pyx_L1_error:;
14120  __Pyx_XDECREF(__pyx_t_6);
14121  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14122  __pyx_r = NULL;
14123  __pyx_L0:;
14124  __Pyx_XDECREF(__pyx_v_result);
14125  __Pyx_XDECREF(__pyx_v_length);
14126  __Pyx_XGIVEREF(__pyx_r);
14127  __Pyx_RefNannyFinishContext();
14128  return __pyx_r;
14129 }
14130 
14131 /* "View.MemoryView":605
14132  * return self._size
14133  *
14134  * def __len__(self): # <<<<<<<<<<<<<<
14135  * if self.view.ndim >= 1:
14136  * return self.view.shape[0]
14137  */
14138 
14139 /* Python wrapper */
14140 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
14141 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
14142  Py_ssize_t __pyx_r;
14143  __Pyx_RefNannyDeclarations
14144  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
14145  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14146 
14147  /* function exit code */
14148  __Pyx_RefNannyFinishContext();
14149  return __pyx_r;
14150 }
14151 
14152 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
14153  Py_ssize_t __pyx_r;
14154  __Pyx_RefNannyDeclarations
14155  int __pyx_t_1;
14156  __Pyx_RefNannySetupContext("__len__", 0);
14157 
14158  /* "View.MemoryView":606
14159  *
14160  * def __len__(self):
14161  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14162  * return self.view.shape[0]
14163  *
14164  */
14165  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14166  if (__pyx_t_1) {
14167 
14168  /* "View.MemoryView":607
14169  * def __len__(self):
14170  * if self.view.ndim >= 1:
14171  * return self.view.shape[0] # <<<<<<<<<<<<<<
14172  *
14173  * return 0
14174  */
14175  __pyx_r = (__pyx_v_self->view.shape[0]);
14176  goto __pyx_L0;
14177 
14178  /* "View.MemoryView":606
14179  *
14180  * def __len__(self):
14181  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14182  * return self.view.shape[0]
14183  *
14184  */
14185  }
14186 
14187  /* "View.MemoryView":609
14188  * return self.view.shape[0]
14189  *
14190  * return 0 # <<<<<<<<<<<<<<
14191  *
14192  * def __repr__(self):
14193  */
14194  __pyx_r = 0;
14195  goto __pyx_L0;
14196 
14197  /* "View.MemoryView":605
14198  * return self._size
14199  *
14200  * def __len__(self): # <<<<<<<<<<<<<<
14201  * if self.view.ndim >= 1:
14202  * return self.view.shape[0]
14203  */
14204 
14205  /* function exit code */
14206  __pyx_L0:;
14207  __Pyx_RefNannyFinishContext();
14208  return __pyx_r;
14209 }
14210 
14211 /* "View.MemoryView":611
14212  * return 0
14213  *
14214  * def __repr__(self): # <<<<<<<<<<<<<<
14215  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14216  * id(self))
14217  */
14218 
14219 /* Python wrapper */
14220 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
14221 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
14222  PyObject *__pyx_r = 0;
14223  __Pyx_RefNannyDeclarations
14224  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
14225  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14226 
14227  /* function exit code */
14228  __Pyx_RefNannyFinishContext();
14229  return __pyx_r;
14230 }
14231 
14232 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
14233  PyObject *__pyx_r = NULL;
14234  __Pyx_RefNannyDeclarations
14235  PyObject *__pyx_t_1 = NULL;
14236  PyObject *__pyx_t_2 = NULL;
14237  PyObject *__pyx_t_3 = NULL;
14238  int __pyx_lineno = 0;
14239  const char *__pyx_filename = NULL;
14240  int __pyx_clineno = 0;
14241  __Pyx_RefNannySetupContext("__repr__", 0);
14242 
14243  /* "View.MemoryView":612
14244  *
14245  * def __repr__(self):
14246  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14247  * id(self))
14248  *
14249  */
14250  __Pyx_XDECREF(__pyx_r);
14251  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
14252  __Pyx_GOTREF(__pyx_t_1);
14253  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error)
14254  __Pyx_GOTREF(__pyx_t_2);
14255  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14256  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
14257  __Pyx_GOTREF(__pyx_t_1);
14258  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14259 
14260  /* "View.MemoryView":613
14261  * def __repr__(self):
14262  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14263  * id(self)) # <<<<<<<<<<<<<<
14264  *
14265  * def __str__(self):
14266  */
14267  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 613, __pyx_L1_error)
14268  __Pyx_GOTREF(__pyx_t_2);
14269 
14270  /* "View.MemoryView":612
14271  *
14272  * def __repr__(self):
14273  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14274  * id(self))
14275  *
14276  */
14277  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 612, __pyx_L1_error)
14278  __Pyx_GOTREF(__pyx_t_3);
14279  __Pyx_GIVEREF(__pyx_t_1);
14280  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14281  __Pyx_GIVEREF(__pyx_t_2);
14282  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14283  __pyx_t_1 = 0;
14284  __pyx_t_2 = 0;
14285  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error)
14286  __Pyx_GOTREF(__pyx_t_2);
14287  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14288  __pyx_r = __pyx_t_2;
14289  __pyx_t_2 = 0;
14290  goto __pyx_L0;
14291 
14292  /* "View.MemoryView":611
14293  * return 0
14294  *
14295  * def __repr__(self): # <<<<<<<<<<<<<<
14296  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14297  * id(self))
14298  */
14299 
14300  /* function exit code */
14301  __pyx_L1_error:;
14302  __Pyx_XDECREF(__pyx_t_1);
14303  __Pyx_XDECREF(__pyx_t_2);
14304  __Pyx_XDECREF(__pyx_t_3);
14305  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14306  __pyx_r = NULL;
14307  __pyx_L0:;
14308  __Pyx_XGIVEREF(__pyx_r);
14309  __Pyx_RefNannyFinishContext();
14310  return __pyx_r;
14311 }
14312 
14313 /* "View.MemoryView":615
14314  * id(self))
14315  *
14316  * def __str__(self): # <<<<<<<<<<<<<<
14317  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14318  *
14319  */
14320 
14321 /* Python wrapper */
14322 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
14323 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14324  PyObject *__pyx_r = 0;
14325  __Pyx_RefNannyDeclarations
14326  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
14327  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14328 
14329  /* function exit code */
14330  __Pyx_RefNannyFinishContext();
14331  return __pyx_r;
14332 }
14333 
14334 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
14335  PyObject *__pyx_r = NULL;
14336  __Pyx_RefNannyDeclarations
14337  PyObject *__pyx_t_1 = NULL;
14338  PyObject *__pyx_t_2 = NULL;
14339  int __pyx_lineno = 0;
14340  const char *__pyx_filename = NULL;
14341  int __pyx_clineno = 0;
14342  __Pyx_RefNannySetupContext("__str__", 0);
14343 
14344  /* "View.MemoryView":616
14345  *
14346  * def __str__(self):
14347  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
14348  *
14349  *
14350  */
14351  __Pyx_XDECREF(__pyx_r);
14352  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
14353  __Pyx_GOTREF(__pyx_t_1);
14354  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error)
14355  __Pyx_GOTREF(__pyx_t_2);
14356  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14357  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
14358  __Pyx_GOTREF(__pyx_t_1);
14359  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14360  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error)
14361  __Pyx_GOTREF(__pyx_t_2);
14362  __Pyx_GIVEREF(__pyx_t_1);
14363  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14364  __pyx_t_1 = 0;
14365  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
14366  __Pyx_GOTREF(__pyx_t_1);
14367  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14368  __pyx_r = __pyx_t_1;
14369  __pyx_t_1 = 0;
14370  goto __pyx_L0;
14371 
14372  /* "View.MemoryView":615
14373  * id(self))
14374  *
14375  * def __str__(self): # <<<<<<<<<<<<<<
14376  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14377  *
14378  */
14379 
14380  /* function exit code */
14381  __pyx_L1_error:;
14382  __Pyx_XDECREF(__pyx_t_1);
14383  __Pyx_XDECREF(__pyx_t_2);
14384  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14385  __pyx_r = NULL;
14386  __pyx_L0:;
14387  __Pyx_XGIVEREF(__pyx_r);
14388  __Pyx_RefNannyFinishContext();
14389  return __pyx_r;
14390 }
14391 
14392 /* "View.MemoryView":619
14393  *
14394  *
14395  * def is_c_contig(self): # <<<<<<<<<<<<<<
14396  * cdef __Pyx_memviewslice *mslice
14397  * cdef __Pyx_memviewslice tmp
14398  */
14399 
14400 /* Python wrapper */
14401 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14402 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14403  PyObject *__pyx_r = 0;
14404  __Pyx_RefNannyDeclarations
14405  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
14406  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14407 
14408  /* function exit code */
14409  __Pyx_RefNannyFinishContext();
14410  return __pyx_r;
14411 }
14412 
14413 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14414  __Pyx_memviewslice *__pyx_v_mslice;
14415  __Pyx_memviewslice __pyx_v_tmp;
14416  PyObject *__pyx_r = NULL;
14417  __Pyx_RefNannyDeclarations
14418  __Pyx_memviewslice *__pyx_t_1;
14419  PyObject *__pyx_t_2 = NULL;
14420  int __pyx_lineno = 0;
14421  const char *__pyx_filename = NULL;
14422  int __pyx_clineno = 0;
14423  __Pyx_RefNannySetupContext("is_c_contig", 0);
14424 
14425  /* "View.MemoryView":622
14426  * cdef __Pyx_memviewslice *mslice
14427  * cdef __Pyx_memviewslice tmp
14428  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14429  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14430  *
14431  */
14432  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 622, __pyx_L1_error)
14433  __pyx_v_mslice = __pyx_t_1;
14434 
14435  /* "View.MemoryView":623
14436  * cdef __Pyx_memviewslice tmp
14437  * mslice = get_slice_from_memview(self, &tmp)
14438  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
14439  *
14440  * def is_f_contig(self):
14441  */
14442  __Pyx_XDECREF(__pyx_r);
14443  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 623, __pyx_L1_error)
14444  __Pyx_GOTREF(__pyx_t_2);
14445  __pyx_r = __pyx_t_2;
14446  __pyx_t_2 = 0;
14447  goto __pyx_L0;
14448 
14449  /* "View.MemoryView":619
14450  *
14451  *
14452  * def is_c_contig(self): # <<<<<<<<<<<<<<
14453  * cdef __Pyx_memviewslice *mslice
14454  * cdef __Pyx_memviewslice tmp
14455  */
14456 
14457  /* function exit code */
14458  __pyx_L1_error:;
14459  __Pyx_XDECREF(__pyx_t_2);
14460  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14461  __pyx_r = NULL;
14462  __pyx_L0:;
14463  __Pyx_XGIVEREF(__pyx_r);
14464  __Pyx_RefNannyFinishContext();
14465  return __pyx_r;
14466 }
14467 
14468 /* "View.MemoryView":625
14469  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14470  *
14471  * def is_f_contig(self): # <<<<<<<<<<<<<<
14472  * cdef __Pyx_memviewslice *mslice
14473  * cdef __Pyx_memviewslice tmp
14474  */
14475 
14476 /* Python wrapper */
14477 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14478 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14479  PyObject *__pyx_r = 0;
14480  __Pyx_RefNannyDeclarations
14481  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
14482  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14483 
14484  /* function exit code */
14485  __Pyx_RefNannyFinishContext();
14486  return __pyx_r;
14487 }
14488 
14489 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14490  __Pyx_memviewslice *__pyx_v_mslice;
14491  __Pyx_memviewslice __pyx_v_tmp;
14492  PyObject *__pyx_r = NULL;
14493  __Pyx_RefNannyDeclarations
14494  __Pyx_memviewslice *__pyx_t_1;
14495  PyObject *__pyx_t_2 = NULL;
14496  int __pyx_lineno = 0;
14497  const char *__pyx_filename = NULL;
14498  int __pyx_clineno = 0;
14499  __Pyx_RefNannySetupContext("is_f_contig", 0);
14500 
14501  /* "View.MemoryView":628
14502  * cdef __Pyx_memviewslice *mslice
14503  * cdef __Pyx_memviewslice tmp
14504  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14505  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14506  *
14507  */
14508  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 628, __pyx_L1_error)
14509  __pyx_v_mslice = __pyx_t_1;
14510 
14511  /* "View.MemoryView":629
14512  * cdef __Pyx_memviewslice tmp
14513  * mslice = get_slice_from_memview(self, &tmp)
14514  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
14515  *
14516  * def copy(self):
14517  */
14518  __Pyx_XDECREF(__pyx_r);
14519  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 629, __pyx_L1_error)
14520  __Pyx_GOTREF(__pyx_t_2);
14521  __pyx_r = __pyx_t_2;
14522  __pyx_t_2 = 0;
14523  goto __pyx_L0;
14524 
14525  /* "View.MemoryView":625
14526  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14527  *
14528  * def is_f_contig(self): # <<<<<<<<<<<<<<
14529  * cdef __Pyx_memviewslice *mslice
14530  * cdef __Pyx_memviewslice tmp
14531  */
14532 
14533  /* function exit code */
14534  __pyx_L1_error:;
14535  __Pyx_XDECREF(__pyx_t_2);
14536  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14537  __pyx_r = NULL;
14538  __pyx_L0:;
14539  __Pyx_XGIVEREF(__pyx_r);
14540  __Pyx_RefNannyFinishContext();
14541  return __pyx_r;
14542 }
14543 
14544 /* "View.MemoryView":631
14545  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14546  *
14547  * def copy(self): # <<<<<<<<<<<<<<
14548  * cdef __Pyx_memviewslice mslice
14549  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14550  */
14551 
14552 /* Python wrapper */
14553 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14554 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14555  PyObject *__pyx_r = 0;
14556  __Pyx_RefNannyDeclarations
14557  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
14558  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
14559 
14560  /* function exit code */
14561  __Pyx_RefNannyFinishContext();
14562  return __pyx_r;
14563 }
14564 
14565 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
14566  __Pyx_memviewslice __pyx_v_mslice;
14567  int __pyx_v_flags;
14568  PyObject *__pyx_r = NULL;
14569  __Pyx_RefNannyDeclarations
14570  __Pyx_memviewslice __pyx_t_1;
14571  PyObject *__pyx_t_2 = NULL;
14572  int __pyx_lineno = 0;
14573  const char *__pyx_filename = NULL;
14574  int __pyx_clineno = 0;
14575  __Pyx_RefNannySetupContext("copy", 0);
14576 
14577  /* "View.MemoryView":633
14578  * def copy(self):
14579  * cdef __Pyx_memviewslice mslice
14580  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
14581  *
14582  * slice_copy(self, &mslice)
14583  */
14584  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14585 
14586  /* "View.MemoryView":635
14587  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14588  *
14589  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
14590  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
14591  * self.view.itemsize,
14592  */
14593  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14594 
14595  /* "View.MemoryView":636
14596  *
14597  * slice_copy(self, &mslice)
14598  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
14599  * self.view.itemsize,
14600  * flags|PyBUF_C_CONTIGUOUS,
14601  */
14602  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 636, __pyx_L1_error)
14603  __pyx_v_mslice = __pyx_t_1;
14604 
14605  /* "View.MemoryView":641
14606  * self.dtype_is_object)
14607  *
14608  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
14609  *
14610  * def copy_fortran(self):
14611  */
14612  __Pyx_XDECREF(__pyx_r);
14613  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 641, __pyx_L1_error)
14614  __Pyx_GOTREF(__pyx_t_2);
14615  __pyx_r = __pyx_t_2;
14616  __pyx_t_2 = 0;
14617  goto __pyx_L0;
14618 
14619  /* "View.MemoryView":631
14620  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14621  *
14622  * def copy(self): # <<<<<<<<<<<<<<
14623  * cdef __Pyx_memviewslice mslice
14624  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14625  */
14626 
14627  /* function exit code */
14628  __pyx_L1_error:;
14629  __Pyx_XDECREF(__pyx_t_2);
14630  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14631  __pyx_r = NULL;
14632  __pyx_L0:;
14633  __Pyx_XGIVEREF(__pyx_r);
14634  __Pyx_RefNannyFinishContext();
14635  return __pyx_r;
14636 }
14637 
14638 /* "View.MemoryView":643
14639  * return memoryview_copy_from_slice(self, &mslice)
14640  *
14641  * def copy_fortran(self): # <<<<<<<<<<<<<<
14642  * cdef __Pyx_memviewslice src, dst
14643  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14644  */
14645 
14646 /* Python wrapper */
14647 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14648 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14649  PyObject *__pyx_r = 0;
14650  __Pyx_RefNannyDeclarations
14651  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
14652  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
14653 
14654  /* function exit code */
14655  __Pyx_RefNannyFinishContext();
14656  return __pyx_r;
14657 }
14658 
14659 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
14660  __Pyx_memviewslice __pyx_v_src;
14661  __Pyx_memviewslice __pyx_v_dst;
14662  int __pyx_v_flags;
14663  PyObject *__pyx_r = NULL;
14664  __Pyx_RefNannyDeclarations
14665  __Pyx_memviewslice __pyx_t_1;
14666  PyObject *__pyx_t_2 = NULL;
14667  int __pyx_lineno = 0;
14668  const char *__pyx_filename = NULL;
14669  int __pyx_clineno = 0;
14670  __Pyx_RefNannySetupContext("copy_fortran", 0);
14671 
14672  /* "View.MemoryView":645
14673  * def copy_fortran(self):
14674  * cdef __Pyx_memviewslice src, dst
14675  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
14676  *
14677  * slice_copy(self, &src)
14678  */
14679  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14680 
14681  /* "View.MemoryView":647
14682  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14683  *
14684  * slice_copy(self, &src) # <<<<<<<<<<<<<<
14685  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
14686  * self.view.itemsize,
14687  */
14688  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14689 
14690  /* "View.MemoryView":648
14691  *
14692  * slice_copy(self, &src)
14693  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
14694  * self.view.itemsize,
14695  * flags|PyBUF_F_CONTIGUOUS,
14696  */
14697  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 648, __pyx_L1_error)
14698  __pyx_v_dst = __pyx_t_1;
14699 
14700  /* "View.MemoryView":653
14701  * self.dtype_is_object)
14702  *
14703  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
14704  *
14705  *
14706  */
14707  __Pyx_XDECREF(__pyx_r);
14708  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error)
14709  __Pyx_GOTREF(__pyx_t_2);
14710  __pyx_r = __pyx_t_2;
14711  __pyx_t_2 = 0;
14712  goto __pyx_L0;
14713 
14714  /* "View.MemoryView":643
14715  * return memoryview_copy_from_slice(self, &mslice)
14716  *
14717  * def copy_fortran(self): # <<<<<<<<<<<<<<
14718  * cdef __Pyx_memviewslice src, dst
14719  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14720  */
14721 
14722  /* function exit code */
14723  __pyx_L1_error:;
14724  __Pyx_XDECREF(__pyx_t_2);
14725  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14726  __pyx_r = NULL;
14727  __pyx_L0:;
14728  __Pyx_XGIVEREF(__pyx_r);
14729  __Pyx_RefNannyFinishContext();
14730  return __pyx_r;
14731 }
14732 
14733 /* "(tree fragment)":1
14734  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14735  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14736  * def __setstate_cython__(self, __pyx_state):
14737  */
14738 
14739 /* Python wrapper */
14740 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14741 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14742  PyObject *__pyx_r = 0;
14743  __Pyx_RefNannyDeclarations
14744  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14745  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14746 
14747  /* function exit code */
14748  __Pyx_RefNannyFinishContext();
14749  return __pyx_r;
14750 }
14751 
14752 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
14753  PyObject *__pyx_r = NULL;
14754  __Pyx_RefNannyDeclarations
14755  PyObject *__pyx_t_1 = NULL;
14756  int __pyx_lineno = 0;
14757  const char *__pyx_filename = NULL;
14758  int __pyx_clineno = 0;
14759  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14760 
14761  /* "(tree fragment)":2
14762  * def __reduce_cython__(self):
14763  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14764  * def __setstate_cython__(self, __pyx_state):
14765  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14766  */
14767  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
14768  __Pyx_GOTREF(__pyx_t_1);
14769  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14770  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14771  __PYX_ERR(2, 2, __pyx_L1_error)
14772 
14773  /* "(tree fragment)":1
14774  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14775  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14776  * def __setstate_cython__(self, __pyx_state):
14777  */
14778 
14779  /* function exit code */
14780  __pyx_L1_error:;
14781  __Pyx_XDECREF(__pyx_t_1);
14782  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14783  __pyx_r = NULL;
14784  __Pyx_XGIVEREF(__pyx_r);
14785  __Pyx_RefNannyFinishContext();
14786  return __pyx_r;
14787 }
14788 
14789 /* "(tree fragment)":3
14790  * def __reduce_cython__(self):
14791  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14792  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14793  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14794  */
14795 
14796 /* Python wrapper */
14797 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
14798 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14799  PyObject *__pyx_r = 0;
14800  __Pyx_RefNannyDeclarations
14801  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14802  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14803 
14804  /* function exit code */
14805  __Pyx_RefNannyFinishContext();
14806  return __pyx_r;
14807 }
14808 
14809 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14810  PyObject *__pyx_r = NULL;
14811  __Pyx_RefNannyDeclarations
14812  PyObject *__pyx_t_1 = NULL;
14813  int __pyx_lineno = 0;
14814  const char *__pyx_filename = NULL;
14815  int __pyx_clineno = 0;
14816  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14817 
14818  /* "(tree fragment)":4
14819  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14820  * def __setstate_cython__(self, __pyx_state):
14821  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14822  */
14823  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
14824  __Pyx_GOTREF(__pyx_t_1);
14825  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14826  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14827  __PYX_ERR(2, 4, __pyx_L1_error)
14828 
14829  /* "(tree fragment)":3
14830  * def __reduce_cython__(self):
14831  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14832  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14833  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14834  */
14835 
14836  /* function exit code */
14837  __pyx_L1_error:;
14838  __Pyx_XDECREF(__pyx_t_1);
14839  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14840  __pyx_r = NULL;
14841  __Pyx_XGIVEREF(__pyx_r);
14842  __Pyx_RefNannyFinishContext();
14843  return __pyx_r;
14844 }
14845 
14846 /* "View.MemoryView":657
14847  *
14848  * @cname('__pyx_memoryview_new')
14849  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14850  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14851  * result.typeinfo = typeinfo
14852  */
14853 
14854 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14855  struct __pyx_memoryview_obj *__pyx_v_result = 0;
14856  PyObject *__pyx_r = NULL;
14857  __Pyx_RefNannyDeclarations
14858  PyObject *__pyx_t_1 = NULL;
14859  PyObject *__pyx_t_2 = NULL;
14860  PyObject *__pyx_t_3 = NULL;
14861  int __pyx_lineno = 0;
14862  const char *__pyx_filename = NULL;
14863  int __pyx_clineno = 0;
14864  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
14865 
14866  /* "View.MemoryView":658
14867  * @cname('__pyx_memoryview_new')
14868  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14869  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
14870  * result.typeinfo = typeinfo
14871  * return result
14872  */
14873  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 658, __pyx_L1_error)
14874  __Pyx_GOTREF(__pyx_t_1);
14875  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
14876  __Pyx_GOTREF(__pyx_t_2);
14877  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error)
14878  __Pyx_GOTREF(__pyx_t_3);
14879  __Pyx_INCREF(__pyx_v_o);
14880  __Pyx_GIVEREF(__pyx_v_o);
14881  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14882  __Pyx_GIVEREF(__pyx_t_1);
14883  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14884  __Pyx_GIVEREF(__pyx_t_2);
14885  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14886  __pyx_t_1 = 0;
14887  __pyx_t_2 = 0;
14888  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
14889  __Pyx_GOTREF(__pyx_t_2);
14890  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14891  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14892  __pyx_t_2 = 0;
14893 
14894  /* "View.MemoryView":659
14895  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14896  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14897  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
14898  * return result
14899  *
14900  */
14901  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14902 
14903  /* "View.MemoryView":660
14904  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14905  * result.typeinfo = typeinfo
14906  * return result # <<<<<<<<<<<<<<
14907  *
14908  * @cname('__pyx_memoryview_check')
14909  */
14910  __Pyx_XDECREF(__pyx_r);
14911  __Pyx_INCREF(((PyObject *)__pyx_v_result));
14912  __pyx_r = ((PyObject *)__pyx_v_result);
14913  goto __pyx_L0;
14914 
14915  /* "View.MemoryView":657
14916  *
14917  * @cname('__pyx_memoryview_new')
14918  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14919  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14920  * result.typeinfo = typeinfo
14921  */
14922 
14923  /* function exit code */
14924  __pyx_L1_error:;
14925  __Pyx_XDECREF(__pyx_t_1);
14926  __Pyx_XDECREF(__pyx_t_2);
14927  __Pyx_XDECREF(__pyx_t_3);
14928  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14929  __pyx_r = 0;
14930  __pyx_L0:;
14931  __Pyx_XDECREF((PyObject *)__pyx_v_result);
14932  __Pyx_XGIVEREF(__pyx_r);
14933  __Pyx_RefNannyFinishContext();
14934  return __pyx_r;
14935 }
14936 
14937 /* "View.MemoryView":663
14938  *
14939  * @cname('__pyx_memoryview_check')
14940  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14941  * return isinstance(o, memoryview)
14942  *
14943  */
14944 
14945 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14946  int __pyx_r;
14947  __Pyx_RefNannyDeclarations
14948  int __pyx_t_1;
14949  __Pyx_RefNannySetupContext("memoryview_check", 0);
14950 
14951  /* "View.MemoryView":664
14952  * @cname('__pyx_memoryview_check')
14953  * cdef inline bint memoryview_check(object o):
14954  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
14955  *
14956  * cdef tuple _unellipsify(object index, int ndim):
14957  */
14958  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14959  __pyx_r = __pyx_t_1;
14960  goto __pyx_L0;
14961 
14962  /* "View.MemoryView":663
14963  *
14964  * @cname('__pyx_memoryview_check')
14965  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14966  * return isinstance(o, memoryview)
14967  *
14968  */
14969 
14970  /* function exit code */
14971  __pyx_L0:;
14972  __Pyx_RefNannyFinishContext();
14973  return __pyx_r;
14974 }
14975 
14976 /* "View.MemoryView":666
14977  * return isinstance(o, memoryview)
14978  *
14979  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14980  * """
14981  * Replace all ellipses with full slices and fill incomplete indices with
14982  */
14983 
14984 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
14985  PyObject *__pyx_v_tup = NULL;
14986  PyObject *__pyx_v_result = NULL;
14987  int __pyx_v_have_slices;
14988  int __pyx_v_seen_ellipsis;
14989  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14990  PyObject *__pyx_v_item = NULL;
14991  Py_ssize_t __pyx_v_nslices;
14992  PyObject *__pyx_r = NULL;
14993  __Pyx_RefNannyDeclarations
14994  int __pyx_t_1;
14995  int __pyx_t_2;
14996  PyObject *__pyx_t_3 = NULL;
14997  PyObject *__pyx_t_4 = NULL;
14998  Py_ssize_t __pyx_t_5;
14999  PyObject *(*__pyx_t_6)(PyObject *);
15000  PyObject *__pyx_t_7 = NULL;
15001  Py_ssize_t __pyx_t_8;
15002  int __pyx_t_9;
15003  int __pyx_t_10;
15004  PyObject *__pyx_t_11 = NULL;
15005  int __pyx_lineno = 0;
15006  const char *__pyx_filename = NULL;
15007  int __pyx_clineno = 0;
15008  __Pyx_RefNannySetupContext("_unellipsify", 0);
15009 
15010  /* "View.MemoryView":671
15011  * full slices.
15012  * """
15013  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15014  * tup = (index,)
15015  * else:
15016  */
15017  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
15018  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15019  if (__pyx_t_2) {
15020 
15021  /* "View.MemoryView":672
15022  * """
15023  * if not isinstance(index, tuple):
15024  * tup = (index,) # <<<<<<<<<<<<<<
15025  * else:
15026  * tup = index
15027  */
15028  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 672, __pyx_L1_error)
15029  __Pyx_GOTREF(__pyx_t_3);
15030  __Pyx_INCREF(__pyx_v_index);
15031  __Pyx_GIVEREF(__pyx_v_index);
15032  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
15033  __pyx_v_tup = __pyx_t_3;
15034  __pyx_t_3 = 0;
15035 
15036  /* "View.MemoryView":671
15037  * full slices.
15038  * """
15039  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15040  * tup = (index,)
15041  * else:
15042  */
15043  goto __pyx_L3;
15044  }
15045 
15046  /* "View.MemoryView":674
15047  * tup = (index,)
15048  * else:
15049  * tup = index # <<<<<<<<<<<<<<
15050  *
15051  * result = []
15052  */
15053  /*else*/ {
15054  __Pyx_INCREF(__pyx_v_index);
15055  __pyx_v_tup = __pyx_v_index;
15056  }
15057  __pyx_L3:;
15058 
15059  /* "View.MemoryView":676
15060  * tup = index
15061  *
15062  * result = [] # <<<<<<<<<<<<<<
15063  * have_slices = False
15064  * seen_ellipsis = False
15065  */
15066  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 676, __pyx_L1_error)
15067  __Pyx_GOTREF(__pyx_t_3);
15068  __pyx_v_result = ((PyObject*)__pyx_t_3);
15069  __pyx_t_3 = 0;
15070 
15071  /* "View.MemoryView":677
15072  *
15073  * result = []
15074  * have_slices = False # <<<<<<<<<<<<<<
15075  * seen_ellipsis = False
15076  * for idx, item in enumerate(tup):
15077  */
15078  __pyx_v_have_slices = 0;
15079 
15080  /* "View.MemoryView":678
15081  * result = []
15082  * have_slices = False
15083  * seen_ellipsis = False # <<<<<<<<<<<<<<
15084  * for idx, item in enumerate(tup):
15085  * if item is Ellipsis:
15086  */
15087  __pyx_v_seen_ellipsis = 0;
15088 
15089  /* "View.MemoryView":679
15090  * have_slices = False
15091  * seen_ellipsis = False
15092  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15093  * if item is Ellipsis:
15094  * if not seen_ellipsis:
15095  */
15096  __Pyx_INCREF(__pyx_int_0);
15097  __pyx_t_3 = __pyx_int_0;
15098  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
15099  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
15100  __pyx_t_6 = NULL;
15101  } else {
15102  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 679, __pyx_L1_error)
15103  __Pyx_GOTREF(__pyx_t_4);
15104  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 679, __pyx_L1_error)
15105  }
15106  for (;;) {
15107  if (likely(!__pyx_t_6)) {
15108  if (likely(PyList_CheckExact(__pyx_t_4))) {
15109  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
15110  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15111  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error)
15112  #else
15113  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
15114  __Pyx_GOTREF(__pyx_t_7);
15115  #endif
15116  } else {
15117  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
15118  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15119  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error)
15120  #else
15121  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
15122  __Pyx_GOTREF(__pyx_t_7);
15123  #endif
15124  }
15125  } else {
15126  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
15127  if (unlikely(!__pyx_t_7)) {
15128  PyObject* exc_type = PyErr_Occurred();
15129  if (exc_type) {
15130  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15131  else __PYX_ERR(2, 679, __pyx_L1_error)
15132  }
15133  break;
15134  }
15135  __Pyx_GOTREF(__pyx_t_7);
15136  }
15137  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
15138  __pyx_t_7 = 0;
15139  __Pyx_INCREF(__pyx_t_3);
15140  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
15141  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
15142  __Pyx_GOTREF(__pyx_t_7);
15143  __Pyx_DECREF(__pyx_t_3);
15144  __pyx_t_3 = __pyx_t_7;
15145  __pyx_t_7 = 0;
15146 
15147  /* "View.MemoryView":680
15148  * seen_ellipsis = False
15149  * for idx, item in enumerate(tup):
15150  * if item is Ellipsis: # <<<<<<<<<<<<<<
15151  * if not seen_ellipsis:
15152  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15153  */
15154  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
15155  __pyx_t_1 = (__pyx_t_2 != 0);
15156  if (__pyx_t_1) {
15157 
15158  /* "View.MemoryView":681
15159  * for idx, item in enumerate(tup):
15160  * if item is Ellipsis:
15161  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15162  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15163  * seen_ellipsis = True
15164  */
15165  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15166  if (__pyx_t_1) {
15167 
15168  /* "View.MemoryView":682
15169  * if item is Ellipsis:
15170  * if not seen_ellipsis:
15171  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
15172  * seen_ellipsis = True
15173  * else:
15174  */
15175  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 682, __pyx_L1_error)
15176  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 682, __pyx_L1_error)
15177  __Pyx_GOTREF(__pyx_t_7);
15178  { Py_ssize_t __pyx_temp;
15179  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15180  __Pyx_INCREF(__pyx_slice__17);
15181  __Pyx_GIVEREF(__pyx_slice__17);
15182  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__17);
15183  }
15184  }
15185  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 682, __pyx_L1_error)
15186  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15187 
15188  /* "View.MemoryView":683
15189  * if not seen_ellipsis:
15190  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15191  * seen_ellipsis = True # <<<<<<<<<<<<<<
15192  * else:
15193  * result.append(slice(None))
15194  */
15195  __pyx_v_seen_ellipsis = 1;
15196 
15197  /* "View.MemoryView":681
15198  * for idx, item in enumerate(tup):
15199  * if item is Ellipsis:
15200  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15201  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15202  * seen_ellipsis = True
15203  */
15204  goto __pyx_L7;
15205  }
15206 
15207  /* "View.MemoryView":685
15208  * seen_ellipsis = True
15209  * else:
15210  * result.append(slice(None)) # <<<<<<<<<<<<<<
15211  * have_slices = True
15212  * else:
15213  */
15214  /*else*/ {
15215  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__17); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 685, __pyx_L1_error)
15216  }
15217  __pyx_L7:;
15218 
15219  /* "View.MemoryView":686
15220  * else:
15221  * result.append(slice(None))
15222  * have_slices = True # <<<<<<<<<<<<<<
15223  * else:
15224  * if not isinstance(item, slice) and not PyIndex_Check(item):
15225  */
15226  __pyx_v_have_slices = 1;
15227 
15228  /* "View.MemoryView":680
15229  * seen_ellipsis = False
15230  * for idx, item in enumerate(tup):
15231  * if item is Ellipsis: # <<<<<<<<<<<<<<
15232  * if not seen_ellipsis:
15233  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15234  */
15235  goto __pyx_L6;
15236  }
15237 
15238  /* "View.MemoryView":688
15239  * have_slices = True
15240  * else:
15241  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15242  * raise TypeError("Cannot index with type '%s'" % type(item))
15243  *
15244  */
15245  /*else*/ {
15246  __pyx_t_2 = PySlice_Check(__pyx_v_item);
15247  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
15248  if (__pyx_t_10) {
15249  } else {
15250  __pyx_t_1 = __pyx_t_10;
15251  goto __pyx_L9_bool_binop_done;
15252  }
15253  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
15254  __pyx_t_1 = __pyx_t_10;
15255  __pyx_L9_bool_binop_done:;
15256  if (unlikely(__pyx_t_1)) {
15257 
15258  /* "View.MemoryView":689
15259  * else:
15260  * if not isinstance(item, slice) and not PyIndex_Check(item):
15261  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
15262  *
15263  * have_slices = have_slices or isinstance(item, slice)
15264  */
15265  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 689, __pyx_L1_error)
15266  __Pyx_GOTREF(__pyx_t_7);
15267  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 689, __pyx_L1_error)
15268  __Pyx_GOTREF(__pyx_t_11);
15269  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15270  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
15271  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15272  __PYX_ERR(2, 689, __pyx_L1_error)
15273 
15274  /* "View.MemoryView":688
15275  * have_slices = True
15276  * else:
15277  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15278  * raise TypeError("Cannot index with type '%s'" % type(item))
15279  *
15280  */
15281  }
15282 
15283  /* "View.MemoryView":691
15284  * raise TypeError("Cannot index with type '%s'" % type(item))
15285  *
15286  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
15287  * result.append(item)
15288  *
15289  */
15290  __pyx_t_10 = (__pyx_v_have_slices != 0);
15291  if (!__pyx_t_10) {
15292  } else {
15293  __pyx_t_1 = __pyx_t_10;
15294  goto __pyx_L11_bool_binop_done;
15295  }
15296  __pyx_t_10 = PySlice_Check(__pyx_v_item);
15297  __pyx_t_2 = (__pyx_t_10 != 0);
15298  __pyx_t_1 = __pyx_t_2;
15299  __pyx_L11_bool_binop_done:;
15300  __pyx_v_have_slices = __pyx_t_1;
15301 
15302  /* "View.MemoryView":692
15303  *
15304  * have_slices = have_slices or isinstance(item, slice)
15305  * result.append(item) # <<<<<<<<<<<<<<
15306  *
15307  * nslices = ndim - len(result)
15308  */
15309  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 692, __pyx_L1_error)
15310  }
15311  __pyx_L6:;
15312 
15313  /* "View.MemoryView":679
15314  * have_slices = False
15315  * seen_ellipsis = False
15316  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15317  * if item is Ellipsis:
15318  * if not seen_ellipsis:
15319  */
15320  }
15321  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15322  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15323 
15324  /* "View.MemoryView":694
15325  * result.append(item)
15326  *
15327  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
15328  * if nslices:
15329  * result.extend([slice(None)] * nslices)
15330  */
15331  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 694, __pyx_L1_error)
15332  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15333 
15334  /* "View.MemoryView":695
15335  *
15336  * nslices = ndim - len(result)
15337  * if nslices: # <<<<<<<<<<<<<<
15338  * result.extend([slice(None)] * nslices)
15339  *
15340  */
15341  __pyx_t_1 = (__pyx_v_nslices != 0);
15342  if (__pyx_t_1) {
15343 
15344  /* "View.MemoryView":696
15345  * nslices = ndim - len(result)
15346  * if nslices:
15347  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
15348  *
15349  * return have_slices or nslices, tuple(result)
15350  */
15351  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 696, __pyx_L1_error)
15352  __Pyx_GOTREF(__pyx_t_3);
15353  { Py_ssize_t __pyx_temp;
15354  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15355  __Pyx_INCREF(__pyx_slice__17);
15356  __Pyx_GIVEREF(__pyx_slice__17);
15357  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__17);
15358  }
15359  }
15360  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 696, __pyx_L1_error)
15361  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15362 
15363  /* "View.MemoryView":695
15364  *
15365  * nslices = ndim - len(result)
15366  * if nslices: # <<<<<<<<<<<<<<
15367  * result.extend([slice(None)] * nslices)
15368  *
15369  */
15370  }
15371 
15372  /* "View.MemoryView":698
15373  * result.extend([slice(None)] * nslices)
15374  *
15375  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
15376  *
15377  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15378  */
15379  __Pyx_XDECREF(__pyx_r);
15380  if (!__pyx_v_have_slices) {
15381  } else {
15382  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
15383  __Pyx_GOTREF(__pyx_t_4);
15384  __pyx_t_3 = __pyx_t_4;
15385  __pyx_t_4 = 0;
15386  goto __pyx_L14_bool_binop_done;
15387  }
15388  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
15389  __Pyx_GOTREF(__pyx_t_4);
15390  __pyx_t_3 = __pyx_t_4;
15391  __pyx_t_4 = 0;
15392  __pyx_L14_bool_binop_done:;
15393  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
15394  __Pyx_GOTREF(__pyx_t_4);
15395  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 698, __pyx_L1_error)
15396  __Pyx_GOTREF(__pyx_t_11);
15397  __Pyx_GIVEREF(__pyx_t_3);
15398  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15399  __Pyx_GIVEREF(__pyx_t_4);
15400  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15401  __pyx_t_3 = 0;
15402  __pyx_t_4 = 0;
15403  __pyx_r = ((PyObject*)__pyx_t_11);
15404  __pyx_t_11 = 0;
15405  goto __pyx_L0;
15406 
15407  /* "View.MemoryView":666
15408  * return isinstance(o, memoryview)
15409  *
15410  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15411  * """
15412  * Replace all ellipses with full slices and fill incomplete indices with
15413  */
15414 
15415  /* function exit code */
15416  __pyx_L1_error:;
15417  __Pyx_XDECREF(__pyx_t_3);
15418  __Pyx_XDECREF(__pyx_t_4);
15419  __Pyx_XDECREF(__pyx_t_7);
15420  __Pyx_XDECREF(__pyx_t_11);
15421  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15422  __pyx_r = 0;
15423  __pyx_L0:;
15424  __Pyx_XDECREF(__pyx_v_tup);
15425  __Pyx_XDECREF(__pyx_v_result);
15426  __Pyx_XDECREF(__pyx_v_idx);
15427  __Pyx_XDECREF(__pyx_v_item);
15428  __Pyx_XGIVEREF(__pyx_r);
15429  __Pyx_RefNannyFinishContext();
15430  return __pyx_r;
15431 }
15432 
15433 /* "View.MemoryView":700
15434  * return have_slices or nslices, tuple(result)
15435  *
15436  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15437  * for suboffset in suboffsets[:ndim]:
15438  * if suboffset >= 0:
15439  */
15440 
15441 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
15442  Py_ssize_t __pyx_v_suboffset;
15443  PyObject *__pyx_r = NULL;
15444  __Pyx_RefNannyDeclarations
15445  Py_ssize_t *__pyx_t_1;
15446  Py_ssize_t *__pyx_t_2;
15447  Py_ssize_t *__pyx_t_3;
15448  int __pyx_t_4;
15449  PyObject *__pyx_t_5 = NULL;
15450  int __pyx_lineno = 0;
15451  const char *__pyx_filename = NULL;
15452  int __pyx_clineno = 0;
15453  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
15454 
15455  /* "View.MemoryView":701
15456  *
15457  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15458  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
15459  * if suboffset >= 0:
15460  * raise ValueError("Indirect dimensions not supported")
15461  */
15462  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15463  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15464  __pyx_t_1 = __pyx_t_3;
15465  __pyx_v_suboffset = (__pyx_t_1[0]);
15466 
15467  /* "View.MemoryView":702
15468  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15469  * for suboffset in suboffsets[:ndim]:
15470  * if suboffset >= 0: # <<<<<<<<<<<<<<
15471  * raise ValueError("Indirect dimensions not supported")
15472  *
15473  */
15474  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15475  if (unlikely(__pyx_t_4)) {
15476 
15477  /* "View.MemoryView":703
15478  * for suboffset in suboffsets[:ndim]:
15479  * if suboffset >= 0:
15480  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
15481  *
15482  *
15483  */
15484  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 703, __pyx_L1_error)
15485  __Pyx_GOTREF(__pyx_t_5);
15486  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15487  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15488  __PYX_ERR(2, 703, __pyx_L1_error)
15489 
15490  /* "View.MemoryView":702
15491  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15492  * for suboffset in suboffsets[:ndim]:
15493  * if suboffset >= 0: # <<<<<<<<<<<<<<
15494  * raise ValueError("Indirect dimensions not supported")
15495  *
15496  */
15497  }
15498  }
15499 
15500  /* "View.MemoryView":700
15501  * return have_slices or nslices, tuple(result)
15502  *
15503  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15504  * for suboffset in suboffsets[:ndim]:
15505  * if suboffset >= 0:
15506  */
15507 
15508  /* function exit code */
15509  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15510  goto __pyx_L0;
15511  __pyx_L1_error:;
15512  __Pyx_XDECREF(__pyx_t_5);
15513  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15514  __pyx_r = 0;
15515  __pyx_L0:;
15516  __Pyx_XGIVEREF(__pyx_r);
15517  __Pyx_RefNannyFinishContext();
15518  return __pyx_r;
15519 }
15520 
15521 /* "View.MemoryView":710
15522  *
15523  * @cname('__pyx_memview_slice')
15524  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15525  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15526  * cdef bint negative_step
15527  */
15528 
15529 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15530  int __pyx_v_new_ndim;
15531  int __pyx_v_suboffset_dim;
15532  int __pyx_v_dim;
15533  __Pyx_memviewslice __pyx_v_src;
15534  __Pyx_memviewslice __pyx_v_dst;
15535  __Pyx_memviewslice *__pyx_v_p_src;
15536  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15537  __Pyx_memviewslice *__pyx_v_p_dst;
15538  int *__pyx_v_p_suboffset_dim;
15539  Py_ssize_t __pyx_v_start;
15540  Py_ssize_t __pyx_v_stop;
15541  Py_ssize_t __pyx_v_step;
15542  int __pyx_v_have_start;
15543  int __pyx_v_have_stop;
15544  int __pyx_v_have_step;
15545  PyObject *__pyx_v_index = NULL;
15546  struct __pyx_memoryview_obj *__pyx_r = NULL;
15547  __Pyx_RefNannyDeclarations
15548  int __pyx_t_1;
15549  int __pyx_t_2;
15550  PyObject *__pyx_t_3 = NULL;
15551  struct __pyx_memoryview_obj *__pyx_t_4;
15552  char *__pyx_t_5;
15553  int __pyx_t_6;
15554  Py_ssize_t __pyx_t_7;
15555  PyObject *(*__pyx_t_8)(PyObject *);
15556  PyObject *__pyx_t_9 = NULL;
15557  Py_ssize_t __pyx_t_10;
15558  int __pyx_t_11;
15559  Py_ssize_t __pyx_t_12;
15560  int __pyx_lineno = 0;
15561  const char *__pyx_filename = NULL;
15562  int __pyx_clineno = 0;
15563  __Pyx_RefNannySetupContext("memview_slice", 0);
15564 
15565  /* "View.MemoryView":711
15566  * @cname('__pyx_memview_slice')
15567  * cdef memoryview memview_slice(memoryview memview, object indices):
15568  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
15569  * cdef bint negative_step
15570  * cdef __Pyx_memviewslice src, dst
15571  */
15572  __pyx_v_new_ndim = 0;
15573  __pyx_v_suboffset_dim = -1;
15574 
15575  /* "View.MemoryView":718
15576  *
15577  *
15578  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
15579  *
15580  * cdef _memoryviewslice memviewsliceobj
15581  */
15582  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
15583 
15584  /* "View.MemoryView":722
15585  * cdef _memoryviewslice memviewsliceobj
15586  *
15587  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
15588  *
15589  * if isinstance(memview, _memoryviewslice):
15590  */
15591  #ifndef CYTHON_WITHOUT_ASSERTIONS
15592  if (unlikely(!Py_OptimizeFlag)) {
15593  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15594  PyErr_SetNone(PyExc_AssertionError);
15595  __PYX_ERR(2, 722, __pyx_L1_error)
15596  }
15597  }
15598  #endif
15599 
15600  /* "View.MemoryView":724
15601  * assert memview.view.ndim > 0
15602  *
15603  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15604  * memviewsliceobj = memview
15605  * p_src = &memviewsliceobj.from_slice
15606  */
15607  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15608  __pyx_t_2 = (__pyx_t_1 != 0);
15609  if (__pyx_t_2) {
15610 
15611  /* "View.MemoryView":725
15612  *
15613  * if isinstance(memview, _memoryviewslice):
15614  * memviewsliceobj = memview # <<<<<<<<<<<<<<
15615  * p_src = &memviewsliceobj.from_slice
15616  * else:
15617  */
15618  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 725, __pyx_L1_error)
15619  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15620  __Pyx_INCREF(__pyx_t_3);
15621  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15622  __pyx_t_3 = 0;
15623 
15624  /* "View.MemoryView":726
15625  * if isinstance(memview, _memoryviewslice):
15626  * memviewsliceobj = memview
15627  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
15628  * else:
15629  * slice_copy(memview, &src)
15630  */
15631  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15632 
15633  /* "View.MemoryView":724
15634  * assert memview.view.ndim > 0
15635  *
15636  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15637  * memviewsliceobj = memview
15638  * p_src = &memviewsliceobj.from_slice
15639  */
15640  goto __pyx_L3;
15641  }
15642 
15643  /* "View.MemoryView":728
15644  * p_src = &memviewsliceobj.from_slice
15645  * else:
15646  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
15647  * p_src = &src
15648  *
15649  */
15650  /*else*/ {
15651  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15652 
15653  /* "View.MemoryView":729
15654  * else:
15655  * slice_copy(memview, &src)
15656  * p_src = &src # <<<<<<<<<<<<<<
15657  *
15658  *
15659  */
15660  __pyx_v_p_src = (&__pyx_v_src);
15661  }
15662  __pyx_L3:;
15663 
15664  /* "View.MemoryView":735
15665  *
15666  *
15667  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
15668  * dst.data = p_src.data
15669  *
15670  */
15671  __pyx_t_4 = __pyx_v_p_src->memview;
15672  __pyx_v_dst.memview = __pyx_t_4;
15673 
15674  /* "View.MemoryView":736
15675  *
15676  * dst.memview = p_src.memview
15677  * dst.data = p_src.data # <<<<<<<<<<<<<<
15678  *
15679  *
15680  */
15681  __pyx_t_5 = __pyx_v_p_src->data;
15682  __pyx_v_dst.data = __pyx_t_5;
15683 
15684  /* "View.MemoryView":741
15685  *
15686  *
15687  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
15688  * cdef int *p_suboffset_dim = &suboffset_dim
15689  * cdef Py_ssize_t start, stop, step
15690  */
15691  __pyx_v_p_dst = (&__pyx_v_dst);
15692 
15693  /* "View.MemoryView":742
15694  *
15695  * cdef __Pyx_memviewslice *p_dst = &dst
15696  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
15697  * cdef Py_ssize_t start, stop, step
15698  * cdef bint have_start, have_stop, have_step
15699  */
15700  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15701 
15702  /* "View.MemoryView":746
15703  * cdef bint have_start, have_stop, have_step
15704  *
15705  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15706  * if PyIndex_Check(index):
15707  * slice_memviewslice(
15708  */
15709  __pyx_t_6 = 0;
15710  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15711  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15712  __pyx_t_8 = NULL;
15713  } else {
15714  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 746, __pyx_L1_error)
15715  __Pyx_GOTREF(__pyx_t_3);
15716  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 746, __pyx_L1_error)
15717  }
15718  for (;;) {
15719  if (likely(!__pyx_t_8)) {
15720  if (likely(PyList_CheckExact(__pyx_t_3))) {
15721  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
15722  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15723  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error)
15724  #else
15725  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
15726  __Pyx_GOTREF(__pyx_t_9);
15727  #endif
15728  } else {
15729  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
15730  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15731  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error)
15732  #else
15733  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
15734  __Pyx_GOTREF(__pyx_t_9);
15735  #endif
15736  }
15737  } else {
15738  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15739  if (unlikely(!__pyx_t_9)) {
15740  PyObject* exc_type = PyErr_Occurred();
15741  if (exc_type) {
15742  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15743  else __PYX_ERR(2, 746, __pyx_L1_error)
15744  }
15745  break;
15746  }
15747  __Pyx_GOTREF(__pyx_t_9);
15748  }
15749  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15750  __pyx_t_9 = 0;
15751  __pyx_v_dim = __pyx_t_6;
15752  __pyx_t_6 = (__pyx_t_6 + 1);
15753 
15754  /* "View.MemoryView":747
15755  *
15756  * for dim, index in enumerate(indices):
15757  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15758  * slice_memviewslice(
15759  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15760  */
15761  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15762  if (__pyx_t_2) {
15763 
15764  /* "View.MemoryView":751
15765  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15766  * dim, new_ndim, p_suboffset_dim,
15767  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
15768  * 0, 0, 0, # have_{start,stop,step}
15769  * False)
15770  */
15771  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 751, __pyx_L1_error)
15772 
15773  /* "View.MemoryView":748
15774  * for dim, index in enumerate(indices):
15775  * if PyIndex_Check(index):
15776  * slice_memviewslice( # <<<<<<<<<<<<<<
15777  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15778  * dim, new_ndim, p_suboffset_dim,
15779  */
15780  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 748, __pyx_L1_error)
15781 
15782  /* "View.MemoryView":747
15783  *
15784  * for dim, index in enumerate(indices):
15785  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15786  * slice_memviewslice(
15787  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15788  */
15789  goto __pyx_L6;
15790  }
15791 
15792  /* "View.MemoryView":754
15793  * 0, 0, 0, # have_{start,stop,step}
15794  * False)
15795  * elif index is None: # <<<<<<<<<<<<<<
15796  * p_dst.shape[new_ndim] = 1
15797  * p_dst.strides[new_ndim] = 0
15798  */
15799  __pyx_t_2 = (__pyx_v_index == Py_None);
15800  __pyx_t_1 = (__pyx_t_2 != 0);
15801  if (__pyx_t_1) {
15802 
15803  /* "View.MemoryView":755
15804  * False)
15805  * elif index is None:
15806  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
15807  * p_dst.strides[new_ndim] = 0
15808  * p_dst.suboffsets[new_ndim] = -1
15809  */
15810  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15811 
15812  /* "View.MemoryView":756
15813  * elif index is None:
15814  * p_dst.shape[new_ndim] = 1
15815  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
15816  * p_dst.suboffsets[new_ndim] = -1
15817  * new_ndim += 1
15818  */
15819  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15820 
15821  /* "View.MemoryView":757
15822  * p_dst.shape[new_ndim] = 1
15823  * p_dst.strides[new_ndim] = 0
15824  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
15825  * new_ndim += 1
15826  * else:
15827  */
15828  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15829 
15830  /* "View.MemoryView":758
15831  * p_dst.strides[new_ndim] = 0
15832  * p_dst.suboffsets[new_ndim] = -1
15833  * new_ndim += 1 # <<<<<<<<<<<<<<
15834  * else:
15835  * start = index.start or 0
15836  */
15837  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15838 
15839  /* "View.MemoryView":754
15840  * 0, 0, 0, # have_{start,stop,step}
15841  * False)
15842  * elif index is None: # <<<<<<<<<<<<<<
15843  * p_dst.shape[new_ndim] = 1
15844  * p_dst.strides[new_ndim] = 0
15845  */
15846  goto __pyx_L6;
15847  }
15848 
15849  /* "View.MemoryView":760
15850  * new_ndim += 1
15851  * else:
15852  * start = index.start or 0 # <<<<<<<<<<<<<<
15853  * stop = index.stop or 0
15854  * step = index.step or 0
15855  */
15856  /*else*/ {
15857  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 760, __pyx_L1_error)
15858  __Pyx_GOTREF(__pyx_t_9);
15859  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 760, __pyx_L1_error)
15860  if (!__pyx_t_1) {
15861  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15862  } else {
15863  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 760, __pyx_L1_error)
15864  __pyx_t_10 = __pyx_t_12;
15865  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15866  goto __pyx_L7_bool_binop_done;
15867  }
15868  __pyx_t_10 = 0;
15869  __pyx_L7_bool_binop_done:;
15870  __pyx_v_start = __pyx_t_10;
15871 
15872  /* "View.MemoryView":761
15873  * else:
15874  * start = index.start or 0
15875  * stop = index.stop or 0 # <<<<<<<<<<<<<<
15876  * step = index.step or 0
15877  *
15878  */
15879  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 761, __pyx_L1_error)
15880  __Pyx_GOTREF(__pyx_t_9);
15881  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 761, __pyx_L1_error)
15882  if (!__pyx_t_1) {
15883  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15884  } else {
15885  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 761, __pyx_L1_error)
15886  __pyx_t_10 = __pyx_t_12;
15887  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15888  goto __pyx_L9_bool_binop_done;
15889  }
15890  __pyx_t_10 = 0;
15891  __pyx_L9_bool_binop_done:;
15892  __pyx_v_stop = __pyx_t_10;
15893 
15894  /* "View.MemoryView":762
15895  * start = index.start or 0
15896  * stop = index.stop or 0
15897  * step = index.step or 0 # <<<<<<<<<<<<<<
15898  *
15899  * have_start = index.start is not None
15900  */
15901  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error)
15902  __Pyx_GOTREF(__pyx_t_9);
15903  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error)
15904  if (!__pyx_t_1) {
15905  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15906  } else {
15907  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error)
15908  __pyx_t_10 = __pyx_t_12;
15909  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15910  goto __pyx_L11_bool_binop_done;
15911  }
15912  __pyx_t_10 = 0;
15913  __pyx_L11_bool_binop_done:;
15914  __pyx_v_step = __pyx_t_10;
15915 
15916  /* "View.MemoryView":764
15917  * step = index.step or 0
15918  *
15919  * have_start = index.start is not None # <<<<<<<<<<<<<<
15920  * have_stop = index.stop is not None
15921  * have_step = index.step is not None
15922  */
15923  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error)
15924  __Pyx_GOTREF(__pyx_t_9);
15925  __pyx_t_1 = (__pyx_t_9 != Py_None);
15926  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15927  __pyx_v_have_start = __pyx_t_1;
15928 
15929  /* "View.MemoryView":765
15930  *
15931  * have_start = index.start is not None
15932  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
15933  * have_step = index.step is not None
15934  *
15935  */
15936  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 765, __pyx_L1_error)
15937  __Pyx_GOTREF(__pyx_t_9);
15938  __pyx_t_1 = (__pyx_t_9 != Py_None);
15939  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15940  __pyx_v_have_stop = __pyx_t_1;
15941 
15942  /* "View.MemoryView":766
15943  * have_start = index.start is not None
15944  * have_stop = index.stop is not None
15945  * have_step = index.step is not None # <<<<<<<<<<<<<<
15946  *
15947  * slice_memviewslice(
15948  */
15949  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error)
15950  __Pyx_GOTREF(__pyx_t_9);
15951  __pyx_t_1 = (__pyx_t_9 != Py_None);
15952  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15953  __pyx_v_have_step = __pyx_t_1;
15954 
15955  /* "View.MemoryView":768
15956  * have_step = index.step is not None
15957  *
15958  * slice_memviewslice( # <<<<<<<<<<<<<<
15959  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15960  * dim, new_ndim, p_suboffset_dim,
15961  */
15962  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 768, __pyx_L1_error)
15963 
15964  /* "View.MemoryView":774
15965  * have_start, have_stop, have_step,
15966  * True)
15967  * new_ndim += 1 # <<<<<<<<<<<<<<
15968  *
15969  * if isinstance(memview, _memoryviewslice):
15970  */
15971  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15972  }
15973  __pyx_L6:;
15974 
15975  /* "View.MemoryView":746
15976  * cdef bint have_start, have_stop, have_step
15977  *
15978  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15979  * if PyIndex_Check(index):
15980  * slice_memviewslice(
15981  */
15982  }
15983  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15984 
15985  /* "View.MemoryView":776
15986  * new_ndim += 1
15987  *
15988  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15989  * return memoryview_fromslice(dst, new_ndim,
15990  * memviewsliceobj.to_object_func,
15991  */
15992  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15993  __pyx_t_2 = (__pyx_t_1 != 0);
15994  if (__pyx_t_2) {
15995 
15996  /* "View.MemoryView":777
15997  *
15998  * if isinstance(memview, _memoryviewslice):
15999  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16000  * memviewsliceobj.to_object_func,
16001  * memviewsliceobj.to_dtype_func,
16002  */
16003  __Pyx_XDECREF(((PyObject *)__pyx_r));
16004 
16005  /* "View.MemoryView":778
16006  * if isinstance(memview, _memoryviewslice):
16007  * return memoryview_fromslice(dst, new_ndim,
16008  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
16009  * memviewsliceobj.to_dtype_func,
16010  * memview.dtype_is_object)
16011  */
16012  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 778, __pyx_L1_error) }
16013 
16014  /* "View.MemoryView":779
16015  * return memoryview_fromslice(dst, new_ndim,
16016  * memviewsliceobj.to_object_func,
16017  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
16018  * memview.dtype_is_object)
16019  * else:
16020  */
16021  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 779, __pyx_L1_error) }
16022 
16023  /* "View.MemoryView":777
16024  *
16025  * if isinstance(memview, _memoryviewslice):
16026  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16027  * memviewsliceobj.to_object_func,
16028  * memviewsliceobj.to_dtype_func,
16029  */
16030  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 777, __pyx_L1_error)
16031  __Pyx_GOTREF(__pyx_t_3);
16032  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 777, __pyx_L1_error)
16033  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16034  __pyx_t_3 = 0;
16035  goto __pyx_L0;
16036 
16037  /* "View.MemoryView":776
16038  * new_ndim += 1
16039  *
16040  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16041  * return memoryview_fromslice(dst, new_ndim,
16042  * memviewsliceobj.to_object_func,
16043  */
16044  }
16045 
16046  /* "View.MemoryView":782
16047  * memview.dtype_is_object)
16048  * else:
16049  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16050  * memview.dtype_is_object)
16051  *
16052  */
16053  /*else*/ {
16054  __Pyx_XDECREF(((PyObject *)__pyx_r));
16055 
16056  /* "View.MemoryView":783
16057  * else:
16058  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
16059  * memview.dtype_is_object) # <<<<<<<<<<<<<<
16060  *
16061  *
16062  */
16063  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 782, __pyx_L1_error)
16064  __Pyx_GOTREF(__pyx_t_3);
16065 
16066  /* "View.MemoryView":782
16067  * memview.dtype_is_object)
16068  * else:
16069  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16070  * memview.dtype_is_object)
16071  *
16072  */
16073  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 782, __pyx_L1_error)
16074  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16075  __pyx_t_3 = 0;
16076  goto __pyx_L0;
16077  }
16078 
16079  /* "View.MemoryView":710
16080  *
16081  * @cname('__pyx_memview_slice')
16082  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
16083  * cdef int new_ndim = 0, suboffset_dim = -1, dim
16084  * cdef bint negative_step
16085  */
16086 
16087  /* function exit code */
16088  __pyx_L1_error:;
16089  __Pyx_XDECREF(__pyx_t_3);
16090  __Pyx_XDECREF(__pyx_t_9);
16091  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16092  __pyx_r = 0;
16093  __pyx_L0:;
16094  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
16095  __Pyx_XDECREF(__pyx_v_index);
16096  __Pyx_XGIVEREF((PyObject *)__pyx_r);
16097  __Pyx_RefNannyFinishContext();
16098  return __pyx_r;
16099 }
16100 
16101 /* "View.MemoryView":807
16102  *
16103  * @cname('__pyx_memoryview_slice_memviewslice')
16104  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16105  * __Pyx_memviewslice *dst,
16106  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16107  */
16108 
16109 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
16110  Py_ssize_t __pyx_v_new_shape;
16111  int __pyx_v_negative_step;
16112  int __pyx_r;
16113  int __pyx_t_1;
16114  int __pyx_t_2;
16115  int __pyx_t_3;
16116  int __pyx_lineno = 0;
16117  const char *__pyx_filename = NULL;
16118  int __pyx_clineno = 0;
16119 
16120  /* "View.MemoryView":827
16121  * cdef bint negative_step
16122  *
16123  * if not is_slice: # <<<<<<<<<<<<<<
16124  *
16125  * if start < 0:
16126  */
16127  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
16128  if (__pyx_t_1) {
16129 
16130  /* "View.MemoryView":829
16131  * if not is_slice:
16132  *
16133  * if start < 0: # <<<<<<<<<<<<<<
16134  * start += shape
16135  * if not 0 <= start < shape:
16136  */
16137  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
16138  if (__pyx_t_1) {
16139 
16140  /* "View.MemoryView":830
16141  *
16142  * if start < 0:
16143  * start += shape # <<<<<<<<<<<<<<
16144  * if not 0 <= start < shape:
16145  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16146  */
16147  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16148 
16149  /* "View.MemoryView":829
16150  * if not is_slice:
16151  *
16152  * if start < 0: # <<<<<<<<<<<<<<
16153  * start += shape
16154  * if not 0 <= start < shape:
16155  */
16156  }
16157 
16158  /* "View.MemoryView":831
16159  * if start < 0:
16160  * start += shape
16161  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16162  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16163  * else:
16164  */
16165  __pyx_t_1 = (0 <= __pyx_v_start);
16166  if (__pyx_t_1) {
16167  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16168  }
16169  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16170  if (__pyx_t_2) {
16171 
16172  /* "View.MemoryView":832
16173  * start += shape
16174  * if not 0 <= start < shape:
16175  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
16176  * else:
16177  *
16178  */
16179  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 832, __pyx_L1_error)
16180 
16181  /* "View.MemoryView":831
16182  * if start < 0:
16183  * start += shape
16184  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16185  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16186  * else:
16187  */
16188  }
16189 
16190  /* "View.MemoryView":827
16191  * cdef bint negative_step
16192  *
16193  * if not is_slice: # <<<<<<<<<<<<<<
16194  *
16195  * if start < 0:
16196  */
16197  goto __pyx_L3;
16198  }
16199 
16200  /* "View.MemoryView":835
16201  * else:
16202  *
16203  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
16204  *
16205  * if have_step and step == 0:
16206  */
16207  /*else*/ {
16208  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16209  if (__pyx_t_1) {
16210  } else {
16211  __pyx_t_2 = __pyx_t_1;
16212  goto __pyx_L6_bool_binop_done;
16213  }
16214  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16215  __pyx_t_2 = __pyx_t_1;
16216  __pyx_L6_bool_binop_done:;
16217  __pyx_v_negative_step = __pyx_t_2;
16218 
16219  /* "View.MemoryView":837
16220  * negative_step = have_step != 0 and step < 0
16221  *
16222  * if have_step and step == 0: # <<<<<<<<<<<<<<
16223  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16224  *
16225  */
16226  __pyx_t_1 = (__pyx_v_have_step != 0);
16227  if (__pyx_t_1) {
16228  } else {
16229  __pyx_t_2 = __pyx_t_1;
16230  goto __pyx_L9_bool_binop_done;
16231  }
16232  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16233  __pyx_t_2 = __pyx_t_1;
16234  __pyx_L9_bool_binop_done:;
16235  if (__pyx_t_2) {
16236 
16237  /* "View.MemoryView":838
16238  *
16239  * if have_step and step == 0:
16240  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
16241  *
16242  *
16243  */
16244  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 838, __pyx_L1_error)
16245 
16246  /* "View.MemoryView":837
16247  * negative_step = have_step != 0 and step < 0
16248  *
16249  * if have_step and step == 0: # <<<<<<<<<<<<<<
16250  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16251  *
16252  */
16253  }
16254 
16255  /* "View.MemoryView":841
16256  *
16257  *
16258  * if have_start: # <<<<<<<<<<<<<<
16259  * if start < 0:
16260  * start += shape
16261  */
16262  __pyx_t_2 = (__pyx_v_have_start != 0);
16263  if (__pyx_t_2) {
16264 
16265  /* "View.MemoryView":842
16266  *
16267  * if have_start:
16268  * if start < 0: # <<<<<<<<<<<<<<
16269  * start += shape
16270  * if start < 0:
16271  */
16272  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16273  if (__pyx_t_2) {
16274 
16275  /* "View.MemoryView":843
16276  * if have_start:
16277  * if start < 0:
16278  * start += shape # <<<<<<<<<<<<<<
16279  * if start < 0:
16280  * start = 0
16281  */
16282  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16283 
16284  /* "View.MemoryView":844
16285  * if start < 0:
16286  * start += shape
16287  * if start < 0: # <<<<<<<<<<<<<<
16288  * start = 0
16289  * elif start >= shape:
16290  */
16291  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16292  if (__pyx_t_2) {
16293 
16294  /* "View.MemoryView":845
16295  * start += shape
16296  * if start < 0:
16297  * start = 0 # <<<<<<<<<<<<<<
16298  * elif start >= shape:
16299  * if negative_step:
16300  */
16301  __pyx_v_start = 0;
16302 
16303  /* "View.MemoryView":844
16304  * if start < 0:
16305  * start += shape
16306  * if start < 0: # <<<<<<<<<<<<<<
16307  * start = 0
16308  * elif start >= shape:
16309  */
16310  }
16311 
16312  /* "View.MemoryView":842
16313  *
16314  * if have_start:
16315  * if start < 0: # <<<<<<<<<<<<<<
16316  * start += shape
16317  * if start < 0:
16318  */
16319  goto __pyx_L12;
16320  }
16321 
16322  /* "View.MemoryView":846
16323  * if start < 0:
16324  * start = 0
16325  * elif start >= shape: # <<<<<<<<<<<<<<
16326  * if negative_step:
16327  * start = shape - 1
16328  */
16329  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16330  if (__pyx_t_2) {
16331 
16332  /* "View.MemoryView":847
16333  * start = 0
16334  * elif start >= shape:
16335  * if negative_step: # <<<<<<<<<<<<<<
16336  * start = shape - 1
16337  * else:
16338  */
16339  __pyx_t_2 = (__pyx_v_negative_step != 0);
16340  if (__pyx_t_2) {
16341 
16342  /* "View.MemoryView":848
16343  * elif start >= shape:
16344  * if negative_step:
16345  * start = shape - 1 # <<<<<<<<<<<<<<
16346  * else:
16347  * start = shape
16348  */
16349  __pyx_v_start = (__pyx_v_shape - 1);
16350 
16351  /* "View.MemoryView":847
16352  * start = 0
16353  * elif start >= shape:
16354  * if negative_step: # <<<<<<<<<<<<<<
16355  * start = shape - 1
16356  * else:
16357  */
16358  goto __pyx_L14;
16359  }
16360 
16361  /* "View.MemoryView":850
16362  * start = shape - 1
16363  * else:
16364  * start = shape # <<<<<<<<<<<<<<
16365  * else:
16366  * if negative_step:
16367  */
16368  /*else*/ {
16369  __pyx_v_start = __pyx_v_shape;
16370  }
16371  __pyx_L14:;
16372 
16373  /* "View.MemoryView":846
16374  * if start < 0:
16375  * start = 0
16376  * elif start >= shape: # <<<<<<<<<<<<<<
16377  * if negative_step:
16378  * start = shape - 1
16379  */
16380  }
16381  __pyx_L12:;
16382 
16383  /* "View.MemoryView":841
16384  *
16385  *
16386  * if have_start: # <<<<<<<<<<<<<<
16387  * if start < 0:
16388  * start += shape
16389  */
16390  goto __pyx_L11;
16391  }
16392 
16393  /* "View.MemoryView":852
16394  * start = shape
16395  * else:
16396  * if negative_step: # <<<<<<<<<<<<<<
16397  * start = shape - 1
16398  * else:
16399  */
16400  /*else*/ {
16401  __pyx_t_2 = (__pyx_v_negative_step != 0);
16402  if (__pyx_t_2) {
16403 
16404  /* "View.MemoryView":853
16405  * else:
16406  * if negative_step:
16407  * start = shape - 1 # <<<<<<<<<<<<<<
16408  * else:
16409  * start = 0
16410  */
16411  __pyx_v_start = (__pyx_v_shape - 1);
16412 
16413  /* "View.MemoryView":852
16414  * start = shape
16415  * else:
16416  * if negative_step: # <<<<<<<<<<<<<<
16417  * start = shape - 1
16418  * else:
16419  */
16420  goto __pyx_L15;
16421  }
16422 
16423  /* "View.MemoryView":855
16424  * start = shape - 1
16425  * else:
16426  * start = 0 # <<<<<<<<<<<<<<
16427  *
16428  * if have_stop:
16429  */
16430  /*else*/ {
16431  __pyx_v_start = 0;
16432  }
16433  __pyx_L15:;
16434  }
16435  __pyx_L11:;
16436 
16437  /* "View.MemoryView":857
16438  * start = 0
16439  *
16440  * if have_stop: # <<<<<<<<<<<<<<
16441  * if stop < 0:
16442  * stop += shape
16443  */
16444  __pyx_t_2 = (__pyx_v_have_stop != 0);
16445  if (__pyx_t_2) {
16446 
16447  /* "View.MemoryView":858
16448  *
16449  * if have_stop:
16450  * if stop < 0: # <<<<<<<<<<<<<<
16451  * stop += shape
16452  * if stop < 0:
16453  */
16454  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16455  if (__pyx_t_2) {
16456 
16457  /* "View.MemoryView":859
16458  * if have_stop:
16459  * if stop < 0:
16460  * stop += shape # <<<<<<<<<<<<<<
16461  * if stop < 0:
16462  * stop = 0
16463  */
16464  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16465 
16466  /* "View.MemoryView":860
16467  * if stop < 0:
16468  * stop += shape
16469  * if stop < 0: # <<<<<<<<<<<<<<
16470  * stop = 0
16471  * elif stop > shape:
16472  */
16473  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16474  if (__pyx_t_2) {
16475 
16476  /* "View.MemoryView":861
16477  * stop += shape
16478  * if stop < 0:
16479  * stop = 0 # <<<<<<<<<<<<<<
16480  * elif stop > shape:
16481  * stop = shape
16482  */
16483  __pyx_v_stop = 0;
16484 
16485  /* "View.MemoryView":860
16486  * if stop < 0:
16487  * stop += shape
16488  * if stop < 0: # <<<<<<<<<<<<<<
16489  * stop = 0
16490  * elif stop > shape:
16491  */
16492  }
16493 
16494  /* "View.MemoryView":858
16495  *
16496  * if have_stop:
16497  * if stop < 0: # <<<<<<<<<<<<<<
16498  * stop += shape
16499  * if stop < 0:
16500  */
16501  goto __pyx_L17;
16502  }
16503 
16504  /* "View.MemoryView":862
16505  * if stop < 0:
16506  * stop = 0
16507  * elif stop > shape: # <<<<<<<<<<<<<<
16508  * stop = shape
16509  * else:
16510  */
16511  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16512  if (__pyx_t_2) {
16513 
16514  /* "View.MemoryView":863
16515  * stop = 0
16516  * elif stop > shape:
16517  * stop = shape # <<<<<<<<<<<<<<
16518  * else:
16519  * if negative_step:
16520  */
16521  __pyx_v_stop = __pyx_v_shape;
16522 
16523  /* "View.MemoryView":862
16524  * if stop < 0:
16525  * stop = 0
16526  * elif stop > shape: # <<<<<<<<<<<<<<
16527  * stop = shape
16528  * else:
16529  */
16530  }
16531  __pyx_L17:;
16532 
16533  /* "View.MemoryView":857
16534  * start = 0
16535  *
16536  * if have_stop: # <<<<<<<<<<<<<<
16537  * if stop < 0:
16538  * stop += shape
16539  */
16540  goto __pyx_L16;
16541  }
16542 
16543  /* "View.MemoryView":865
16544  * stop = shape
16545  * else:
16546  * if negative_step: # <<<<<<<<<<<<<<
16547  * stop = -1
16548  * else:
16549  */
16550  /*else*/ {
16551  __pyx_t_2 = (__pyx_v_negative_step != 0);
16552  if (__pyx_t_2) {
16553 
16554  /* "View.MemoryView":866
16555  * else:
16556  * if negative_step:
16557  * stop = -1 # <<<<<<<<<<<<<<
16558  * else:
16559  * stop = shape
16560  */
16561  __pyx_v_stop = -1L;
16562 
16563  /* "View.MemoryView":865
16564  * stop = shape
16565  * else:
16566  * if negative_step: # <<<<<<<<<<<<<<
16567  * stop = -1
16568  * else:
16569  */
16570  goto __pyx_L19;
16571  }
16572 
16573  /* "View.MemoryView":868
16574  * stop = -1
16575  * else:
16576  * stop = shape # <<<<<<<<<<<<<<
16577  *
16578  * if not have_step:
16579  */
16580  /*else*/ {
16581  __pyx_v_stop = __pyx_v_shape;
16582  }
16583  __pyx_L19:;
16584  }
16585  __pyx_L16:;
16586 
16587  /* "View.MemoryView":870
16588  * stop = shape
16589  *
16590  * if not have_step: # <<<<<<<<<<<<<<
16591  * step = 1
16592  *
16593  */
16594  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16595  if (__pyx_t_2) {
16596 
16597  /* "View.MemoryView":871
16598  *
16599  * if not have_step:
16600  * step = 1 # <<<<<<<<<<<<<<
16601  *
16602  *
16603  */
16604  __pyx_v_step = 1;
16605 
16606  /* "View.MemoryView":870
16607  * stop = shape
16608  *
16609  * if not have_step: # <<<<<<<<<<<<<<
16610  * step = 1
16611  *
16612  */
16613  }
16614 
16615  /* "View.MemoryView":875
16616  *
16617  * with cython.cdivision(True):
16618  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
16619  *
16620  * if (stop - start) - step * new_shape:
16621  */
16622  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16623 
16624  /* "View.MemoryView":877
16625  * new_shape = (stop - start) // step
16626  *
16627  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16628  * new_shape += 1
16629  *
16630  */
16631  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16632  if (__pyx_t_2) {
16633 
16634  /* "View.MemoryView":878
16635  *
16636  * if (stop - start) - step * new_shape:
16637  * new_shape += 1 # <<<<<<<<<<<<<<
16638  *
16639  * if new_shape < 0:
16640  */
16641  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16642 
16643  /* "View.MemoryView":877
16644  * new_shape = (stop - start) // step
16645  *
16646  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16647  * new_shape += 1
16648  *
16649  */
16650  }
16651 
16652  /* "View.MemoryView":880
16653  * new_shape += 1
16654  *
16655  * if new_shape < 0: # <<<<<<<<<<<<<<
16656  * new_shape = 0
16657  *
16658  */
16659  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16660  if (__pyx_t_2) {
16661 
16662  /* "View.MemoryView":881
16663  *
16664  * if new_shape < 0:
16665  * new_shape = 0 # <<<<<<<<<<<<<<
16666  *
16667  *
16668  */
16669  __pyx_v_new_shape = 0;
16670 
16671  /* "View.MemoryView":880
16672  * new_shape += 1
16673  *
16674  * if new_shape < 0: # <<<<<<<<<<<<<<
16675  * new_shape = 0
16676  *
16677  */
16678  }
16679 
16680  /* "View.MemoryView":884
16681  *
16682  *
16683  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
16684  * dst.shape[new_ndim] = new_shape
16685  * dst.suboffsets[new_ndim] = suboffset
16686  */
16687  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16688 
16689  /* "View.MemoryView":885
16690  *
16691  * dst.strides[new_ndim] = stride * step
16692  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
16693  * dst.suboffsets[new_ndim] = suboffset
16694  *
16695  */
16696  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16697 
16698  /* "View.MemoryView":886
16699  * dst.strides[new_ndim] = stride * step
16700  * dst.shape[new_ndim] = new_shape
16701  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
16702  *
16703  *
16704  */
16705  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16706  }
16707  __pyx_L3:;
16708 
16709  /* "View.MemoryView":889
16710  *
16711  *
16712  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16713  * dst.data += start * stride
16714  * else:
16715  */
16716  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16717  if (__pyx_t_2) {
16718 
16719  /* "View.MemoryView":890
16720  *
16721  * if suboffset_dim[0] < 0:
16722  * dst.data += start * stride # <<<<<<<<<<<<<<
16723  * else:
16724  * dst.suboffsets[suboffset_dim[0]] += start * stride
16725  */
16726  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16727 
16728  /* "View.MemoryView":889
16729  *
16730  *
16731  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16732  * dst.data += start * stride
16733  * else:
16734  */
16735  goto __pyx_L23;
16736  }
16737 
16738  /* "View.MemoryView":892
16739  * dst.data += start * stride
16740  * else:
16741  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
16742  *
16743  * if suboffset >= 0:
16744  */
16745  /*else*/ {
16746  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16747  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16748  }
16749  __pyx_L23:;
16750 
16751  /* "View.MemoryView":894
16752  * dst.suboffsets[suboffset_dim[0]] += start * stride
16753  *
16754  * if suboffset >= 0: # <<<<<<<<<<<<<<
16755  * if not is_slice:
16756  * if new_ndim == 0:
16757  */
16758  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16759  if (__pyx_t_2) {
16760 
16761  /* "View.MemoryView":895
16762  *
16763  * if suboffset >= 0:
16764  * if not is_slice: # <<<<<<<<<<<<<<
16765  * if new_ndim == 0:
16766  * dst.data = (<char **> dst.data)[0] + suboffset
16767  */
16768  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16769  if (__pyx_t_2) {
16770 
16771  /* "View.MemoryView":896
16772  * if suboffset >= 0:
16773  * if not is_slice:
16774  * if new_ndim == 0: # <<<<<<<<<<<<<<
16775  * dst.data = (<char **> dst.data)[0] + suboffset
16776  * else:
16777  */
16778  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16779  if (__pyx_t_2) {
16780 
16781  /* "View.MemoryView":897
16782  * if not is_slice:
16783  * if new_ndim == 0:
16784  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
16785  * else:
16786  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16787  */
16788  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16789 
16790  /* "View.MemoryView":896
16791  * if suboffset >= 0:
16792  * if not is_slice:
16793  * if new_ndim == 0: # <<<<<<<<<<<<<<
16794  * dst.data = (<char **> dst.data)[0] + suboffset
16795  * else:
16796  */
16797  goto __pyx_L26;
16798  }
16799 
16800  /* "View.MemoryView":899
16801  * dst.data = (<char **> dst.data)[0] + suboffset
16802  * else:
16803  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
16804  * "must be indexed and not sliced", dim)
16805  * else:
16806  */
16807  /*else*/ {
16808 
16809  /* "View.MemoryView":900
16810  * else:
16811  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16812  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
16813  * else:
16814  * suboffset_dim[0] = new_ndim
16815  */
16816  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 899, __pyx_L1_error)
16817  }
16818  __pyx_L26:;
16819 
16820  /* "View.MemoryView":895
16821  *
16822  * if suboffset >= 0:
16823  * if not is_slice: # <<<<<<<<<<<<<<
16824  * if new_ndim == 0:
16825  * dst.data = (<char **> dst.data)[0] + suboffset
16826  */
16827  goto __pyx_L25;
16828  }
16829 
16830  /* "View.MemoryView":902
16831  * "must be indexed and not sliced", dim)
16832  * else:
16833  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
16834  *
16835  * return 0
16836  */
16837  /*else*/ {
16838  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16839  }
16840  __pyx_L25:;
16841 
16842  /* "View.MemoryView":894
16843  * dst.suboffsets[suboffset_dim[0]] += start * stride
16844  *
16845  * if suboffset >= 0: # <<<<<<<<<<<<<<
16846  * if not is_slice:
16847  * if new_ndim == 0:
16848  */
16849  }
16850 
16851  /* "View.MemoryView":904
16852  * suboffset_dim[0] = new_ndim
16853  *
16854  * return 0 # <<<<<<<<<<<<<<
16855  *
16856  *
16857  */
16858  __pyx_r = 0;
16859  goto __pyx_L0;
16860 
16861  /* "View.MemoryView":807
16862  *
16863  * @cname('__pyx_memoryview_slice_memviewslice')
16864  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16865  * __Pyx_memviewslice *dst,
16866  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16867  */
16868 
16869  /* function exit code */
16870  __pyx_L1_error:;
16871  {
16872  #ifdef WITH_THREAD
16873  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16874  #endif
16875  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16876  #ifdef WITH_THREAD
16877  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16878  #endif
16879  }
16880  __pyx_r = -1;
16881  __pyx_L0:;
16882  return __pyx_r;
16883 }
16884 
16885 /* "View.MemoryView":910
16886  *
16887  * @cname('__pyx_pybuffer_index')
16888  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16889  * Py_ssize_t dim) except NULL:
16890  * cdef Py_ssize_t shape, stride, suboffset = -1
16891  */
16892 
16893 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16894  Py_ssize_t __pyx_v_shape;
16895  Py_ssize_t __pyx_v_stride;
16896  Py_ssize_t __pyx_v_suboffset;
16897  Py_ssize_t __pyx_v_itemsize;
16898  char *__pyx_v_resultp;
16899  char *__pyx_r;
16900  __Pyx_RefNannyDeclarations
16901  Py_ssize_t __pyx_t_1;
16902  int __pyx_t_2;
16903  PyObject *__pyx_t_3 = NULL;
16904  PyObject *__pyx_t_4 = NULL;
16905  int __pyx_lineno = 0;
16906  const char *__pyx_filename = NULL;
16907  int __pyx_clineno = 0;
16908  __Pyx_RefNannySetupContext("pybuffer_index", 0);
16909 
16910  /* "View.MemoryView":912
16911  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
16912  * Py_ssize_t dim) except NULL:
16913  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
16914  * cdef Py_ssize_t itemsize = view.itemsize
16915  * cdef char *resultp
16916  */
16917  __pyx_v_suboffset = -1L;
16918 
16919  /* "View.MemoryView":913
16920  * Py_ssize_t dim) except NULL:
16921  * cdef Py_ssize_t shape, stride, suboffset = -1
16922  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
16923  * cdef char *resultp
16924  *
16925  */
16926  __pyx_t_1 = __pyx_v_view->itemsize;
16927  __pyx_v_itemsize = __pyx_t_1;
16928 
16929  /* "View.MemoryView":916
16930  * cdef char *resultp
16931  *
16932  * if view.ndim == 0: # <<<<<<<<<<<<<<
16933  * shape = view.len / itemsize
16934  * stride = itemsize
16935  */
16936  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16937  if (__pyx_t_2) {
16938 
16939  /* "View.MemoryView":917
16940  *
16941  * if view.ndim == 0:
16942  * shape = view.len / itemsize # <<<<<<<<<<<<<<
16943  * stride = itemsize
16944  * else:
16945  */
16946  if (unlikely(__pyx_v_itemsize == 0)) {
16947  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
16948  __PYX_ERR(2, 917, __pyx_L1_error)
16949  }
16950  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16951  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
16952  __PYX_ERR(2, 917, __pyx_L1_error)
16953  }
16954  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
16955 
16956  /* "View.MemoryView":918
16957  * if view.ndim == 0:
16958  * shape = view.len / itemsize
16959  * stride = itemsize # <<<<<<<<<<<<<<
16960  * else:
16961  * shape = view.shape[dim]
16962  */
16963  __pyx_v_stride = __pyx_v_itemsize;
16964 
16965  /* "View.MemoryView":916
16966  * cdef char *resultp
16967  *
16968  * if view.ndim == 0: # <<<<<<<<<<<<<<
16969  * shape = view.len / itemsize
16970  * stride = itemsize
16971  */
16972  goto __pyx_L3;
16973  }
16974 
16975  /* "View.MemoryView":920
16976  * stride = itemsize
16977  * else:
16978  * shape = view.shape[dim] # <<<<<<<<<<<<<<
16979  * stride = view.strides[dim]
16980  * if view.suboffsets != NULL:
16981  */
16982  /*else*/ {
16983  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16984 
16985  /* "View.MemoryView":921
16986  * else:
16987  * shape = view.shape[dim]
16988  * stride = view.strides[dim] # <<<<<<<<<<<<<<
16989  * if view.suboffsets != NULL:
16990  * suboffset = view.suboffsets[dim]
16991  */
16992  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16993 
16994  /* "View.MemoryView":922
16995  * shape = view.shape[dim]
16996  * stride = view.strides[dim]
16997  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16998  * suboffset = view.suboffsets[dim]
16999  *
17000  */
17001  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
17002  if (__pyx_t_2) {
17003 
17004  /* "View.MemoryView":923
17005  * stride = view.strides[dim]
17006  * if view.suboffsets != NULL:
17007  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
17008  *
17009  * if index < 0:
17010  */
17011  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
17012 
17013  /* "View.MemoryView":922
17014  * shape = view.shape[dim]
17015  * stride = view.strides[dim]
17016  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
17017  * suboffset = view.suboffsets[dim]
17018  *
17019  */
17020  }
17021  }
17022  __pyx_L3:;
17023 
17024  /* "View.MemoryView":925
17025  * suboffset = view.suboffsets[dim]
17026  *
17027  * if index < 0: # <<<<<<<<<<<<<<
17028  * index += view.shape[dim]
17029  * if index < 0:
17030  */
17031  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17032  if (__pyx_t_2) {
17033 
17034  /* "View.MemoryView":926
17035  *
17036  * if index < 0:
17037  * index += view.shape[dim] # <<<<<<<<<<<<<<
17038  * if index < 0:
17039  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17040  */
17041  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
17042 
17043  /* "View.MemoryView":927
17044  * if index < 0:
17045  * index += view.shape[dim]
17046  * if index < 0: # <<<<<<<<<<<<<<
17047  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17048  *
17049  */
17050  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17051  if (unlikely(__pyx_t_2)) {
17052 
17053  /* "View.MemoryView":928
17054  * index += view.shape[dim]
17055  * if index < 0:
17056  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17057  *
17058  * if index >= shape:
17059  */
17060  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error)
17061  __Pyx_GOTREF(__pyx_t_3);
17062  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 928, __pyx_L1_error)
17063  __Pyx_GOTREF(__pyx_t_4);
17064  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17065  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error)
17066  __Pyx_GOTREF(__pyx_t_3);
17067  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17068  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17069  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17070  __PYX_ERR(2, 928, __pyx_L1_error)
17071 
17072  /* "View.MemoryView":927
17073  * if index < 0:
17074  * index += view.shape[dim]
17075  * if index < 0: # <<<<<<<<<<<<<<
17076  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17077  *
17078  */
17079  }
17080 
17081  /* "View.MemoryView":925
17082  * suboffset = view.suboffsets[dim]
17083  *
17084  * if index < 0: # <<<<<<<<<<<<<<
17085  * index += view.shape[dim]
17086  * if index < 0:
17087  */
17088  }
17089 
17090  /* "View.MemoryView":930
17091  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17092  *
17093  * if index >= shape: # <<<<<<<<<<<<<<
17094  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17095  *
17096  */
17097  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
17098  if (unlikely(__pyx_t_2)) {
17099 
17100  /* "View.MemoryView":931
17101  *
17102  * if index >= shape:
17103  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17104  *
17105  * resultp = bufp + index * stride
17106  */
17107  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error)
17108  __Pyx_GOTREF(__pyx_t_3);
17109  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 931, __pyx_L1_error)
17110  __Pyx_GOTREF(__pyx_t_4);
17111  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17112  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error)
17113  __Pyx_GOTREF(__pyx_t_3);
17114  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17115  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17116  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17117  __PYX_ERR(2, 931, __pyx_L1_error)
17118 
17119  /* "View.MemoryView":930
17120  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17121  *
17122  * if index >= shape: # <<<<<<<<<<<<<<
17123  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17124  *
17125  */
17126  }
17127 
17128  /* "View.MemoryView":933
17129  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17130  *
17131  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
17132  * if suboffset >= 0:
17133  * resultp = (<char **> resultp)[0] + suboffset
17134  */
17135  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
17136 
17137  /* "View.MemoryView":934
17138  *
17139  * resultp = bufp + index * stride
17140  * if suboffset >= 0: # <<<<<<<<<<<<<<
17141  * resultp = (<char **> resultp)[0] + suboffset
17142  *
17143  */
17144  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17145  if (__pyx_t_2) {
17146 
17147  /* "View.MemoryView":935
17148  * resultp = bufp + index * stride
17149  * if suboffset >= 0:
17150  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
17151  *
17152  * return resultp
17153  */
17154  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
17155 
17156  /* "View.MemoryView":934
17157  *
17158  * resultp = bufp + index * stride
17159  * if suboffset >= 0: # <<<<<<<<<<<<<<
17160  * resultp = (<char **> resultp)[0] + suboffset
17161  *
17162  */
17163  }
17164 
17165  /* "View.MemoryView":937
17166  * resultp = (<char **> resultp)[0] + suboffset
17167  *
17168  * return resultp # <<<<<<<<<<<<<<
17169  *
17170  *
17171  */
17172  __pyx_r = __pyx_v_resultp;
17173  goto __pyx_L0;
17174 
17175  /* "View.MemoryView":910
17176  *
17177  * @cname('__pyx_pybuffer_index')
17178  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17179  * Py_ssize_t dim) except NULL:
17180  * cdef Py_ssize_t shape, stride, suboffset = -1
17181  */
17182 
17183  /* function exit code */
17184  __pyx_L1_error:;
17185  __Pyx_XDECREF(__pyx_t_3);
17186  __Pyx_XDECREF(__pyx_t_4);
17187  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17188  __pyx_r = NULL;
17189  __pyx_L0:;
17190  __Pyx_RefNannyFinishContext();
17191  return __pyx_r;
17192 }
17193 
17194 /* "View.MemoryView":943
17195  *
17196  * @cname('__pyx_memslice_transpose')
17197  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17198  * cdef int ndim = memslice.memview.view.ndim
17199  *
17200  */
17201 
17202 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17203  int __pyx_v_ndim;
17204  Py_ssize_t *__pyx_v_shape;
17205  Py_ssize_t *__pyx_v_strides;
17206  int __pyx_v_i;
17207  int __pyx_v_j;
17208  int __pyx_r;
17209  int __pyx_t_1;
17210  Py_ssize_t *__pyx_t_2;
17211  long __pyx_t_3;
17212  long __pyx_t_4;
17213  Py_ssize_t __pyx_t_5;
17214  Py_ssize_t __pyx_t_6;
17215  int __pyx_t_7;
17216  int __pyx_t_8;
17217  int __pyx_t_9;
17218  int __pyx_lineno = 0;
17219  const char *__pyx_filename = NULL;
17220  int __pyx_clineno = 0;
17221 
17222  /* "View.MemoryView":944
17223  * @cname('__pyx_memslice_transpose')
17224  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
17225  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
17226  *
17227  * cdef Py_ssize_t *shape = memslice.shape
17228  */
17229  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17230  __pyx_v_ndim = __pyx_t_1;
17231 
17232  /* "View.MemoryView":946
17233  * cdef int ndim = memslice.memview.view.ndim
17234  *
17235  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
17236  * cdef Py_ssize_t *strides = memslice.strides
17237  *
17238  */
17239  __pyx_t_2 = __pyx_v_memslice->shape;
17240  __pyx_v_shape = __pyx_t_2;
17241 
17242  /* "View.MemoryView":947
17243  *
17244  * cdef Py_ssize_t *shape = memslice.shape
17245  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
17246  *
17247  *
17248  */
17249  __pyx_t_2 = __pyx_v_memslice->strides;
17250  __pyx_v_strides = __pyx_t_2;
17251 
17252  /* "View.MemoryView":951
17253  *
17254  * cdef int i, j
17255  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
17256  * j = ndim - 1 - i
17257  * strides[i], strides[j] = strides[j], strides[i]
17258  */
17259  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
17260  __pyx_t_4 = __pyx_t_3;
17261  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
17262  __pyx_v_i = __pyx_t_1;
17263 
17264  /* "View.MemoryView":952
17265  * cdef int i, j
17266  * for i in range(ndim / 2):
17267  * j = ndim - 1 - i # <<<<<<<<<<<<<<
17268  * strides[i], strides[j] = strides[j], strides[i]
17269  * shape[i], shape[j] = shape[j], shape[i]
17270  */
17271  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17272 
17273  /* "View.MemoryView":953
17274  * for i in range(ndim / 2):
17275  * j = ndim - 1 - i
17276  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
17277  * shape[i], shape[j] = shape[j], shape[i]
17278  *
17279  */
17280  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17281  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17282  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17283  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17284 
17285  /* "View.MemoryView":954
17286  * j = ndim - 1 - i
17287  * strides[i], strides[j] = strides[j], strides[i]
17288  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
17289  *
17290  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17291  */
17292  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17293  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17294  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17295  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17296 
17297  /* "View.MemoryView":956
17298  * shape[i], shape[j] = shape[j], shape[i]
17299  *
17300  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17301  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17302  *
17303  */
17304  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17305  if (!__pyx_t_8) {
17306  } else {
17307  __pyx_t_7 = __pyx_t_8;
17308  goto __pyx_L6_bool_binop_done;
17309  }
17310  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17311  __pyx_t_7 = __pyx_t_8;
17312  __pyx_L6_bool_binop_done:;
17313  if (__pyx_t_7) {
17314 
17315  /* "View.MemoryView":957
17316  *
17317  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17318  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
17319  *
17320  * return 1
17321  */
17322  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L1_error)
17323 
17324  /* "View.MemoryView":956
17325  * shape[i], shape[j] = shape[j], shape[i]
17326  *
17327  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17328  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17329  *
17330  */
17331  }
17332  }
17333 
17334  /* "View.MemoryView":959
17335  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17336  *
17337  * return 1 # <<<<<<<<<<<<<<
17338  *
17339  *
17340  */
17341  __pyx_r = 1;
17342  goto __pyx_L0;
17343 
17344  /* "View.MemoryView":943
17345  *
17346  * @cname('__pyx_memslice_transpose')
17347  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17348  * cdef int ndim = memslice.memview.view.ndim
17349  *
17350  */
17351 
17352  /* function exit code */
17353  __pyx_L1_error:;
17354  {
17355  #ifdef WITH_THREAD
17356  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17357  #endif
17358  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17359  #ifdef WITH_THREAD
17360  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17361  #endif
17362  }
17363  __pyx_r = 0;
17364  __pyx_L0:;
17365  return __pyx_r;
17366 }
17367 
17368 /* "View.MemoryView":976
17369  * cdef int (*to_dtype_func)(char *, object) except 0
17370  *
17371  * def __dealloc__(self): # <<<<<<<<<<<<<<
17372  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17373  *
17374  */
17375 
17376 /* Python wrapper */
17377 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
17378 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17379  __Pyx_RefNannyDeclarations
17380  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
17381  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17382 
17383  /* function exit code */
17384  __Pyx_RefNannyFinishContext();
17385 }
17386 
17387 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17388  __Pyx_RefNannyDeclarations
17389  __Pyx_RefNannySetupContext("__dealloc__", 0);
17390 
17391  /* "View.MemoryView":977
17392  *
17393  * def __dealloc__(self):
17394  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
17395  *
17396  * cdef convert_item_to_object(self, char *itemp):
17397  */
17398  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17399 
17400  /* "View.MemoryView":976
17401  * cdef int (*to_dtype_func)(char *, object) except 0
17402  *
17403  * def __dealloc__(self): # <<<<<<<<<<<<<<
17404  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17405  *
17406  */
17407 
17408  /* function exit code */
17409  __Pyx_RefNannyFinishContext();
17410 }
17411 
17412 /* "View.MemoryView":979
17413  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17414  *
17415  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17416  * if self.to_object_func != NULL:
17417  * return self.to_object_func(itemp)
17418  */
17419 
17420 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
17421  PyObject *__pyx_r = NULL;
17422  __Pyx_RefNannyDeclarations
17423  int __pyx_t_1;
17424  PyObject *__pyx_t_2 = NULL;
17425  int __pyx_lineno = 0;
17426  const char *__pyx_filename = NULL;
17427  int __pyx_clineno = 0;
17428  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
17429 
17430  /* "View.MemoryView":980
17431  *
17432  * cdef convert_item_to_object(self, char *itemp):
17433  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17434  * return self.to_object_func(itemp)
17435  * else:
17436  */
17437  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17438  if (__pyx_t_1) {
17439 
17440  /* "View.MemoryView":981
17441  * cdef convert_item_to_object(self, char *itemp):
17442  * if self.to_object_func != NULL:
17443  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
17444  * else:
17445  * return memoryview.convert_item_to_object(self, itemp)
17446  */
17447  __Pyx_XDECREF(__pyx_r);
17448  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 981, __pyx_L1_error)
17449  __Pyx_GOTREF(__pyx_t_2);
17450  __pyx_r = __pyx_t_2;
17451  __pyx_t_2 = 0;
17452  goto __pyx_L0;
17453 
17454  /* "View.MemoryView":980
17455  *
17456  * cdef convert_item_to_object(self, char *itemp):
17457  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17458  * return self.to_object_func(itemp)
17459  * else:
17460  */
17461  }
17462 
17463  /* "View.MemoryView":983
17464  * return self.to_object_func(itemp)
17465  * else:
17466  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
17467  *
17468  * cdef assign_item_from_object(self, char *itemp, object value):
17469  */
17470  /*else*/ {
17471  __Pyx_XDECREF(__pyx_r);
17472  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L1_error)
17473  __Pyx_GOTREF(__pyx_t_2);
17474  __pyx_r = __pyx_t_2;
17475  __pyx_t_2 = 0;
17476  goto __pyx_L0;
17477  }
17478 
17479  /* "View.MemoryView":979
17480  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17481  *
17482  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17483  * if self.to_object_func != NULL:
17484  * return self.to_object_func(itemp)
17485  */
17486 
17487  /* function exit code */
17488  __pyx_L1_error:;
17489  __Pyx_XDECREF(__pyx_t_2);
17490  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17491  __pyx_r = 0;
17492  __pyx_L0:;
17493  __Pyx_XGIVEREF(__pyx_r);
17494  __Pyx_RefNannyFinishContext();
17495  return __pyx_r;
17496 }
17497 
17498 /* "View.MemoryView":985
17499  * return memoryview.convert_item_to_object(self, itemp)
17500  *
17501  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17502  * if self.to_dtype_func != NULL:
17503  * self.to_dtype_func(itemp, value)
17504  */
17505 
17506 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17507  PyObject *__pyx_r = NULL;
17508  __Pyx_RefNannyDeclarations
17509  int __pyx_t_1;
17510  int __pyx_t_2;
17511  PyObject *__pyx_t_3 = NULL;
17512  int __pyx_lineno = 0;
17513  const char *__pyx_filename = NULL;
17514  int __pyx_clineno = 0;
17515  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
17516 
17517  /* "View.MemoryView":986
17518  *
17519  * cdef assign_item_from_object(self, char *itemp, object value):
17520  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17521  * self.to_dtype_func(itemp, value)
17522  * else:
17523  */
17524  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17525  if (__pyx_t_1) {
17526 
17527  /* "View.MemoryView":987
17528  * cdef assign_item_from_object(self, char *itemp, object value):
17529  * if self.to_dtype_func != NULL:
17530  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
17531  * else:
17532  * memoryview.assign_item_from_object(self, itemp, value)
17533  */
17534  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 987, __pyx_L1_error)
17535 
17536  /* "View.MemoryView":986
17537  *
17538  * cdef assign_item_from_object(self, char *itemp, object value):
17539  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17540  * self.to_dtype_func(itemp, value)
17541  * else:
17542  */
17543  goto __pyx_L3;
17544  }
17545 
17546  /* "View.MemoryView":989
17547  * self.to_dtype_func(itemp, value)
17548  * else:
17549  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
17550  *
17551  * @property
17552  */
17553  /*else*/ {
17554  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 989, __pyx_L1_error)
17555  __Pyx_GOTREF(__pyx_t_3);
17556  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17557  }
17558  __pyx_L3:;
17559 
17560  /* "View.MemoryView":985
17561  * return memoryview.convert_item_to_object(self, itemp)
17562  *
17563  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17564  * if self.to_dtype_func != NULL:
17565  * self.to_dtype_func(itemp, value)
17566  */
17567 
17568  /* function exit code */
17569  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17570  goto __pyx_L0;
17571  __pyx_L1_error:;
17572  __Pyx_XDECREF(__pyx_t_3);
17573  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17574  __pyx_r = 0;
17575  __pyx_L0:;
17576  __Pyx_XGIVEREF(__pyx_r);
17577  __Pyx_RefNannyFinishContext();
17578  return __pyx_r;
17579 }
17580 
17581 /* "View.MemoryView":992
17582  *
17583  * @property
17584  * def base(self): # <<<<<<<<<<<<<<
17585  * return self.from_object
17586  *
17587  */
17588 
17589 /* Python wrapper */
17590 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
17591 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17592  PyObject *__pyx_r = 0;
17593  __Pyx_RefNannyDeclarations
17594  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17595  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17596 
17597  /* function exit code */
17598  __Pyx_RefNannyFinishContext();
17599  return __pyx_r;
17600 }
17601 
17602 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17603  PyObject *__pyx_r = NULL;
17604  __Pyx_RefNannyDeclarations
17605  __Pyx_RefNannySetupContext("__get__", 0);
17606 
17607  /* "View.MemoryView":993
17608  * @property
17609  * def base(self):
17610  * return self.from_object # <<<<<<<<<<<<<<
17611  *
17612  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
17613  */
17614  __Pyx_XDECREF(__pyx_r);
17615  __Pyx_INCREF(__pyx_v_self->from_object);
17616  __pyx_r = __pyx_v_self->from_object;
17617  goto __pyx_L0;
17618 
17619  /* "View.MemoryView":992
17620  *
17621  * @property
17622  * def base(self): # <<<<<<<<<<<<<<
17623  * return self.from_object
17624  *
17625  */
17626 
17627  /* function exit code */
17628  __pyx_L0:;
17629  __Pyx_XGIVEREF(__pyx_r);
17630  __Pyx_RefNannyFinishContext();
17631  return __pyx_r;
17632 }
17633 
17634 /* "(tree fragment)":1
17635  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17636  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17637  * def __setstate_cython__(self, __pyx_state):
17638  */
17639 
17640 /* Python wrapper */
17641 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17642 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17643  PyObject *__pyx_r = 0;
17644  __Pyx_RefNannyDeclarations
17645  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17646  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17647 
17648  /* function exit code */
17649  __Pyx_RefNannyFinishContext();
17650  return __pyx_r;
17651 }
17652 
17653 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17654  PyObject *__pyx_r = NULL;
17655  __Pyx_RefNannyDeclarations
17656  PyObject *__pyx_t_1 = NULL;
17657  int __pyx_lineno = 0;
17658  const char *__pyx_filename = NULL;
17659  int __pyx_clineno = 0;
17660  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17661 
17662  /* "(tree fragment)":2
17663  * def __reduce_cython__(self):
17664  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17665  * def __setstate_cython__(self, __pyx_state):
17666  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17667  */
17668  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
17669  __Pyx_GOTREF(__pyx_t_1);
17670  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17671  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17672  __PYX_ERR(2, 2, __pyx_L1_error)
17673 
17674  /* "(tree fragment)":1
17675  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17676  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17677  * def __setstate_cython__(self, __pyx_state):
17678  */
17679 
17680  /* function exit code */
17681  __pyx_L1_error:;
17682  __Pyx_XDECREF(__pyx_t_1);
17683  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17684  __pyx_r = NULL;
17685  __Pyx_XGIVEREF(__pyx_r);
17686  __Pyx_RefNannyFinishContext();
17687  return __pyx_r;
17688 }
17689 
17690 /* "(tree fragment)":3
17691  * def __reduce_cython__(self):
17692  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17693  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17694  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17695  */
17696 
17697 /* Python wrapper */
17698 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
17699 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17700  PyObject *__pyx_r = 0;
17701  __Pyx_RefNannyDeclarations
17702  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
17703  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17704 
17705  /* function exit code */
17706  __Pyx_RefNannyFinishContext();
17707  return __pyx_r;
17708 }
17709 
17710 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17711  PyObject *__pyx_r = NULL;
17712  __Pyx_RefNannyDeclarations
17713  PyObject *__pyx_t_1 = NULL;
17714  int __pyx_lineno = 0;
17715  const char *__pyx_filename = NULL;
17716  int __pyx_clineno = 0;
17717  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
17718 
17719  /* "(tree fragment)":4
17720  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17721  * def __setstate_cython__(self, __pyx_state):
17722  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17723  */
17724  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
17725  __Pyx_GOTREF(__pyx_t_1);
17726  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17727  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17728  __PYX_ERR(2, 4, __pyx_L1_error)
17729 
17730  /* "(tree fragment)":3
17731  * def __reduce_cython__(self):
17732  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17733  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17734  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17735  */
17736 
17737  /* function exit code */
17738  __pyx_L1_error:;
17739  __Pyx_XDECREF(__pyx_t_1);
17740  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17741  __pyx_r = NULL;
17742  __Pyx_XGIVEREF(__pyx_r);
17743  __Pyx_RefNannyFinishContext();
17744  return __pyx_r;
17745 }
17746 
17747 /* "View.MemoryView":999
17748  *
17749  * @cname('__pyx_memoryview_fromslice')
17750  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17751  * int ndim,
17752  * object (*to_object_func)(char *),
17753  */
17754 
17755 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
17756  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17757  Py_ssize_t __pyx_v_suboffset;
17758  PyObject *__pyx_v_length = NULL;
17759  PyObject *__pyx_r = NULL;
17760  __Pyx_RefNannyDeclarations
17761  int __pyx_t_1;
17762  PyObject *__pyx_t_2 = NULL;
17763  PyObject *__pyx_t_3 = NULL;
17764  __Pyx_TypeInfo *__pyx_t_4;
17765  Py_buffer __pyx_t_5;
17766  Py_ssize_t *__pyx_t_6;
17767  Py_ssize_t *__pyx_t_7;
17768  Py_ssize_t *__pyx_t_8;
17769  Py_ssize_t __pyx_t_9;
17770  int __pyx_lineno = 0;
17771  const char *__pyx_filename = NULL;
17772  int __pyx_clineno = 0;
17773  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
17774 
17775  /* "View.MemoryView":1007
17776  * cdef _memoryviewslice result
17777  *
17778  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17779  * return None
17780  *
17781  */
17782  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17783  if (__pyx_t_1) {
17784 
17785  /* "View.MemoryView":1008
17786  *
17787  * if <PyObject *> memviewslice.memview == Py_None:
17788  * return None # <<<<<<<<<<<<<<
17789  *
17790  *
17791  */
17792  __Pyx_XDECREF(__pyx_r);
17793  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17794  goto __pyx_L0;
17795 
17796  /* "View.MemoryView":1007
17797  * cdef _memoryviewslice result
17798  *
17799  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17800  * return None
17801  *
17802  */
17803  }
17804 
17805  /* "View.MemoryView":1013
17806  *
17807  *
17808  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
17809  *
17810  * result.from_slice = memviewslice
17811  */
17812  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
17813  __Pyx_GOTREF(__pyx_t_2);
17814  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1013, __pyx_L1_error)
17815  __Pyx_GOTREF(__pyx_t_3);
17816  __Pyx_INCREF(Py_None);
17817  __Pyx_GIVEREF(Py_None);
17818  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17819  __Pyx_INCREF(__pyx_int_0);
17820  __Pyx_GIVEREF(__pyx_int_0);
17821  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17822  __Pyx_GIVEREF(__pyx_t_2);
17823  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17824  __pyx_t_2 = 0;
17825  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
17826  __Pyx_GOTREF(__pyx_t_2);
17827  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17828  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17829  __pyx_t_2 = 0;
17830 
17831  /* "View.MemoryView":1015
17832  * result = _memoryviewslice(None, 0, dtype_is_object)
17833  *
17834  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
17835  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17836  *
17837  */
17838  __pyx_v_result->from_slice = __pyx_v_memviewslice;
17839 
17840  /* "View.MemoryView":1016
17841  *
17842  * result.from_slice = memviewslice
17843  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
17844  *
17845  * result.from_object = (<memoryview> memviewslice.memview).base
17846  */
17847  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17848 
17849  /* "View.MemoryView":1018
17850  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17851  *
17852  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
17853  * result.typeinfo = memviewslice.memview.typeinfo
17854  *
17855  */
17856  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1018, __pyx_L1_error)
17857  __Pyx_GOTREF(__pyx_t_2);
17858  __Pyx_GIVEREF(__pyx_t_2);
17859  __Pyx_GOTREF(__pyx_v_result->from_object);
17860  __Pyx_DECREF(__pyx_v_result->from_object);
17861  __pyx_v_result->from_object = __pyx_t_2;
17862  __pyx_t_2 = 0;
17863 
17864  /* "View.MemoryView":1019
17865  *
17866  * result.from_object = (<memoryview> memviewslice.memview).base
17867  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
17868  *
17869  * result.view = memviewslice.memview.view
17870  */
17871  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17872  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17873 
17874  /* "View.MemoryView":1021
17875  * result.typeinfo = memviewslice.memview.typeinfo
17876  *
17877  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
17878  * result.view.buf = <void *> memviewslice.data
17879  * result.view.ndim = ndim
17880  */
17881  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17882  __pyx_v_result->__pyx_base.view = __pyx_t_5;
17883 
17884  /* "View.MemoryView":1022
17885  *
17886  * result.view = memviewslice.memview.view
17887  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
17888  * result.view.ndim = ndim
17889  * (<__pyx_buffer *> &result.view).obj = Py_None
17890  */
17891  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
17892 
17893  /* "View.MemoryView":1023
17894  * result.view = memviewslice.memview.view
17895  * result.view.buf = <void *> memviewslice.data
17896  * result.view.ndim = ndim # <<<<<<<<<<<<<<
17897  * (<__pyx_buffer *> &result.view).obj = Py_None
17898  * Py_INCREF(Py_None)
17899  */
17900  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17901 
17902  /* "View.MemoryView":1024
17903  * result.view.buf = <void *> memviewslice.data
17904  * result.view.ndim = ndim
17905  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
17906  * Py_INCREF(Py_None)
17907  *
17908  */
17909  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17910 
17911  /* "View.MemoryView":1025
17912  * result.view.ndim = ndim
17913  * (<__pyx_buffer *> &result.view).obj = Py_None
17914  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
17915  *
17916  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17917  */
17918  Py_INCREF(Py_None);
17919 
17920  /* "View.MemoryView":1027
17921  * Py_INCREF(Py_None)
17922  *
17923  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17924  * result.flags = PyBUF_RECORDS
17925  * else:
17926  */
17927  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17928  if (__pyx_t_1) {
17929 
17930  /* "View.MemoryView":1028
17931  *
17932  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17933  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
17934  * else:
17935  * result.flags = PyBUF_RECORDS_RO
17936  */
17937  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17938 
17939  /* "View.MemoryView":1027
17940  * Py_INCREF(Py_None)
17941  *
17942  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17943  * result.flags = PyBUF_RECORDS
17944  * else:
17945  */
17946  goto __pyx_L4;
17947  }
17948 
17949  /* "View.MemoryView":1030
17950  * result.flags = PyBUF_RECORDS
17951  * else:
17952  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
17953  *
17954  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17955  */
17956  /*else*/ {
17957  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17958  }
17959  __pyx_L4:;
17960 
17961  /* "View.MemoryView":1032
17962  * result.flags = PyBUF_RECORDS_RO
17963  *
17964  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
17965  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
17966  *
17967  */
17968  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17969 
17970  /* "View.MemoryView":1033
17971  *
17972  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17973  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
17974  *
17975  *
17976  */
17977  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17978 
17979  /* "View.MemoryView":1036
17980  *
17981  *
17982  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
17983  * for suboffset in result.from_slice.suboffsets[:ndim]:
17984  * if suboffset >= 0:
17985  */
17986  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17987 
17988  /* "View.MemoryView":1037
17989  *
17990  * result.view.suboffsets = NULL
17991  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
17992  * if suboffset >= 0:
17993  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17994  */
17995  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17996  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17997  __pyx_t_6 = __pyx_t_8;
17998  __pyx_v_suboffset = (__pyx_t_6[0]);
17999 
18000  /* "View.MemoryView":1038
18001  * result.view.suboffsets = NULL
18002  * for suboffset in result.from_slice.suboffsets[:ndim]:
18003  * if suboffset >= 0: # <<<<<<<<<<<<<<
18004  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18005  * break
18006  */
18007  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
18008  if (__pyx_t_1) {
18009 
18010  /* "View.MemoryView":1039
18011  * for suboffset in result.from_slice.suboffsets[:ndim]:
18012  * if suboffset >= 0:
18013  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
18014  * break
18015  *
18016  */
18017  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
18018 
18019  /* "View.MemoryView":1040
18020  * if suboffset >= 0:
18021  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18022  * break # <<<<<<<<<<<<<<
18023  *
18024  * result.view.len = result.view.itemsize
18025  */
18026  goto __pyx_L6_break;
18027 
18028  /* "View.MemoryView":1038
18029  * result.view.suboffsets = NULL
18030  * for suboffset in result.from_slice.suboffsets[:ndim]:
18031  * if suboffset >= 0: # <<<<<<<<<<<<<<
18032  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18033  * break
18034  */
18035  }
18036  }
18037  __pyx_L6_break:;
18038 
18039  /* "View.MemoryView":1042
18040  * break
18041  *
18042  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
18043  * for length in result.view.shape[:ndim]:
18044  * result.view.len *= length
18045  */
18046  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
18047  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18048 
18049  /* "View.MemoryView":1043
18050  *
18051  * result.view.len = result.view.itemsize
18052  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
18053  * result.view.len *= length
18054  *
18055  */
18056  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
18057  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18058  __pyx_t_6 = __pyx_t_8;
18059  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1043, __pyx_L1_error)
18060  __Pyx_GOTREF(__pyx_t_2);
18061  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
18062  __pyx_t_2 = 0;
18063 
18064  /* "View.MemoryView":1044
18065  * result.view.len = result.view.itemsize
18066  * for length in result.view.shape[:ndim]:
18067  * result.view.len *= length # <<<<<<<<<<<<<<
18068  *
18069  * result.to_object_func = to_object_func
18070  */
18071  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1044, __pyx_L1_error)
18072  __Pyx_GOTREF(__pyx_t_2);
18073  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1044, __pyx_L1_error)
18074  __Pyx_GOTREF(__pyx_t_3);
18075  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18076  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1044, __pyx_L1_error)
18077  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18078  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18079  }
18080 
18081  /* "View.MemoryView":1046
18082  * result.view.len *= length
18083  *
18084  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
18085  * result.to_dtype_func = to_dtype_func
18086  *
18087  */
18088  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
18089 
18090  /* "View.MemoryView":1047
18091  *
18092  * result.to_object_func = to_object_func
18093  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
18094  *
18095  * return result
18096  */
18097  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
18098 
18099  /* "View.MemoryView":1049
18100  * result.to_dtype_func = to_dtype_func
18101  *
18102  * return result # <<<<<<<<<<<<<<
18103  *
18104  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18105  */
18106  __Pyx_XDECREF(__pyx_r);
18107  __Pyx_INCREF(((PyObject *)__pyx_v_result));
18108  __pyx_r = ((PyObject *)__pyx_v_result);
18109  goto __pyx_L0;
18110 
18111  /* "View.MemoryView":999
18112  *
18113  * @cname('__pyx_memoryview_fromslice')
18114  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
18115  * int ndim,
18116  * object (*to_object_func)(char *),
18117  */
18118 
18119  /* function exit code */
18120  __pyx_L1_error:;
18121  __Pyx_XDECREF(__pyx_t_2);
18122  __Pyx_XDECREF(__pyx_t_3);
18123  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18124  __pyx_r = 0;
18125  __pyx_L0:;
18126  __Pyx_XDECREF((PyObject *)__pyx_v_result);
18127  __Pyx_XDECREF(__pyx_v_length);
18128  __Pyx_XGIVEREF(__pyx_r);
18129  __Pyx_RefNannyFinishContext();
18130  return __pyx_r;
18131 }
18132 
18133 /* "View.MemoryView":1052
18134  *
18135  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18136  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18137  * __Pyx_memviewslice *mslice) except NULL:
18138  * cdef _memoryviewslice obj
18139  */
18140 
18141 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18142  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18143  __Pyx_memviewslice *__pyx_r;
18144  __Pyx_RefNannyDeclarations
18145  int __pyx_t_1;
18146  int __pyx_t_2;
18147  PyObject *__pyx_t_3 = NULL;
18148  int __pyx_lineno = 0;
18149  const char *__pyx_filename = NULL;
18150  int __pyx_clineno = 0;
18151  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
18152 
18153  /* "View.MemoryView":1055
18154  * __Pyx_memviewslice *mslice) except NULL:
18155  * cdef _memoryviewslice obj
18156  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18157  * obj = memview
18158  * return &obj.from_slice
18159  */
18160  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18161  __pyx_t_2 = (__pyx_t_1 != 0);
18162  if (__pyx_t_2) {
18163 
18164  /* "View.MemoryView":1056
18165  * cdef _memoryviewslice obj
18166  * if isinstance(memview, _memoryviewslice):
18167  * obj = memview # <<<<<<<<<<<<<<
18168  * return &obj.from_slice
18169  * else:
18170  */
18171  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1056, __pyx_L1_error)
18172  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18173  __Pyx_INCREF(__pyx_t_3);
18174  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18175  __pyx_t_3 = 0;
18176 
18177  /* "View.MemoryView":1057
18178  * if isinstance(memview, _memoryviewslice):
18179  * obj = memview
18180  * return &obj.from_slice # <<<<<<<<<<<<<<
18181  * else:
18182  * slice_copy(memview, mslice)
18183  */
18184  __pyx_r = (&__pyx_v_obj->from_slice);
18185  goto __pyx_L0;
18186 
18187  /* "View.MemoryView":1055
18188  * __Pyx_memviewslice *mslice) except NULL:
18189  * cdef _memoryviewslice obj
18190  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18191  * obj = memview
18192  * return &obj.from_slice
18193  */
18194  }
18195 
18196  /* "View.MemoryView":1059
18197  * return &obj.from_slice
18198  * else:
18199  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
18200  * return mslice
18201  *
18202  */
18203  /*else*/ {
18204  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18205 
18206  /* "View.MemoryView":1060
18207  * else:
18208  * slice_copy(memview, mslice)
18209  * return mslice # <<<<<<<<<<<<<<
18210  *
18211  * @cname('__pyx_memoryview_slice_copy')
18212  */
18213  __pyx_r = __pyx_v_mslice;
18214  goto __pyx_L0;
18215  }
18216 
18217  /* "View.MemoryView":1052
18218  *
18219  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18220  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18221  * __Pyx_memviewslice *mslice) except NULL:
18222  * cdef _memoryviewslice obj
18223  */
18224 
18225  /* function exit code */
18226  __pyx_L1_error:;
18227  __Pyx_XDECREF(__pyx_t_3);
18228  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
18229  __pyx_r = NULL;
18230  __pyx_L0:;
18231  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18232  __Pyx_RefNannyFinishContext();
18233  return __pyx_r;
18234 }
18235 
18236 /* "View.MemoryView":1063
18237  *
18238  * @cname('__pyx_memoryview_slice_copy')
18239  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18240  * cdef int dim
18241  * cdef (Py_ssize_t*) shape, strides, suboffsets
18242  */
18243 
18244 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18245  int __pyx_v_dim;
18246  Py_ssize_t *__pyx_v_shape;
18247  Py_ssize_t *__pyx_v_strides;
18248  Py_ssize_t *__pyx_v_suboffsets;
18249  __Pyx_RefNannyDeclarations
18250  Py_ssize_t *__pyx_t_1;
18251  int __pyx_t_2;
18252  int __pyx_t_3;
18253  int __pyx_t_4;
18254  Py_ssize_t __pyx_t_5;
18255  __Pyx_RefNannySetupContext("slice_copy", 0);
18256 
18257  /* "View.MemoryView":1067
18258  * cdef (Py_ssize_t*) shape, strides, suboffsets
18259  *
18260  * shape = memview.view.shape # <<<<<<<<<<<<<<
18261  * strides = memview.view.strides
18262  * suboffsets = memview.view.suboffsets
18263  */
18264  __pyx_t_1 = __pyx_v_memview->view.shape;
18265  __pyx_v_shape = __pyx_t_1;
18266 
18267  /* "View.MemoryView":1068
18268  *
18269  * shape = memview.view.shape
18270  * strides = memview.view.strides # <<<<<<<<<<<<<<
18271  * suboffsets = memview.view.suboffsets
18272  *
18273  */
18274  __pyx_t_1 = __pyx_v_memview->view.strides;
18275  __pyx_v_strides = __pyx_t_1;
18276 
18277  /* "View.MemoryView":1069
18278  * shape = memview.view.shape
18279  * strides = memview.view.strides
18280  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
18281  *
18282  * dst.memview = <__pyx_memoryview *> memview
18283  */
18284  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18285  __pyx_v_suboffsets = __pyx_t_1;
18286 
18287  /* "View.MemoryView":1071
18288  * suboffsets = memview.view.suboffsets
18289  *
18290  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
18291  * dst.data = <char *> memview.view.buf
18292  *
18293  */
18294  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
18295 
18296  /* "View.MemoryView":1072
18297  *
18298  * dst.memview = <__pyx_memoryview *> memview
18299  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
18300  *
18301  * for dim in range(memview.view.ndim):
18302  */
18303  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
18304 
18305  /* "View.MemoryView":1074
18306  * dst.data = <char *> memview.view.buf
18307  *
18308  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
18309  * dst.shape[dim] = shape[dim]
18310  * dst.strides[dim] = strides[dim]
18311  */
18312  __pyx_t_2 = __pyx_v_memview->view.ndim;
18313  __pyx_t_3 = __pyx_t_2;
18314  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18315  __pyx_v_dim = __pyx_t_4;
18316 
18317  /* "View.MemoryView":1075
18318  *
18319  * for dim in range(memview.view.ndim):
18320  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
18321  * dst.strides[dim] = strides[dim]
18322  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18323  */
18324  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18325 
18326  /* "View.MemoryView":1076
18327  * for dim in range(memview.view.ndim):
18328  * dst.shape[dim] = shape[dim]
18329  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
18330  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18331  *
18332  */
18333  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18334 
18335  /* "View.MemoryView":1077
18336  * dst.shape[dim] = shape[dim]
18337  * dst.strides[dim] = strides[dim]
18338  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
18339  *
18340  * @cname('__pyx_memoryview_copy_object')
18341  */
18342  if ((__pyx_v_suboffsets != 0)) {
18343  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18344  } else {
18345  __pyx_t_5 = -1L;
18346  }
18347  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18348  }
18349 
18350  /* "View.MemoryView":1063
18351  *
18352  * @cname('__pyx_memoryview_slice_copy')
18353  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18354  * cdef int dim
18355  * cdef (Py_ssize_t*) shape, strides, suboffsets
18356  */
18357 
18358  /* function exit code */
18359  __Pyx_RefNannyFinishContext();
18360 }
18361 
18362 /* "View.MemoryView":1080
18363  *
18364  * @cname('__pyx_memoryview_copy_object')
18365  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18366  * "Create a new memoryview object"
18367  * cdef __Pyx_memviewslice memviewslice
18368  */
18369 
18370 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
18371  __Pyx_memviewslice __pyx_v_memviewslice;
18372  PyObject *__pyx_r = NULL;
18373  __Pyx_RefNannyDeclarations
18374  PyObject *__pyx_t_1 = NULL;
18375  int __pyx_lineno = 0;
18376  const char *__pyx_filename = NULL;
18377  int __pyx_clineno = 0;
18378  __Pyx_RefNannySetupContext("memoryview_copy", 0);
18379 
18380  /* "View.MemoryView":1083
18381  * "Create a new memoryview object"
18382  * cdef __Pyx_memviewslice memviewslice
18383  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
18384  * return memoryview_copy_from_slice(memview, &memviewslice)
18385  *
18386  */
18387  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18388 
18389  /* "View.MemoryView":1084
18390  * cdef __Pyx_memviewslice memviewslice
18391  * slice_copy(memview, &memviewslice)
18392  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
18393  *
18394  * @cname('__pyx_memoryview_copy_object_from_slice')
18395  */
18396  __Pyx_XDECREF(__pyx_r);
18397  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1084, __pyx_L1_error)
18398  __Pyx_GOTREF(__pyx_t_1);
18399  __pyx_r = __pyx_t_1;
18400  __pyx_t_1 = 0;
18401  goto __pyx_L0;
18402 
18403  /* "View.MemoryView":1080
18404  *
18405  * @cname('__pyx_memoryview_copy_object')
18406  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18407  * "Create a new memoryview object"
18408  * cdef __Pyx_memviewslice memviewslice
18409  */
18410 
18411  /* function exit code */
18412  __pyx_L1_error:;
18413  __Pyx_XDECREF(__pyx_t_1);
18414  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18415  __pyx_r = 0;
18416  __pyx_L0:;
18417  __Pyx_XGIVEREF(__pyx_r);
18418  __Pyx_RefNannyFinishContext();
18419  return __pyx_r;
18420 }
18421 
18422 /* "View.MemoryView":1087
18423  *
18424  * @cname('__pyx_memoryview_copy_object_from_slice')
18425  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18426  * """
18427  * Create a new memoryview object from a given memoryview object and slice.
18428  */
18429 
18430 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18431  PyObject *(*__pyx_v_to_object_func)(char *);
18432  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
18433  PyObject *__pyx_r = NULL;
18434  __Pyx_RefNannyDeclarations
18435  int __pyx_t_1;
18436  int __pyx_t_2;
18437  PyObject *(*__pyx_t_3)(char *);
18438  int (*__pyx_t_4)(char *, PyObject *);
18439  PyObject *__pyx_t_5 = NULL;
18440  int __pyx_lineno = 0;
18441  const char *__pyx_filename = NULL;
18442  int __pyx_clineno = 0;
18443  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
18444 
18445  /* "View.MemoryView":1094
18446  * cdef int (*to_dtype_func)(char *, object) except 0
18447  *
18448  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18449  * to_object_func = (<_memoryviewslice> memview).to_object_func
18450  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18451  */
18452  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18453  __pyx_t_2 = (__pyx_t_1 != 0);
18454  if (__pyx_t_2) {
18455 
18456  /* "View.MemoryView":1095
18457  *
18458  * if isinstance(memview, _memoryviewslice):
18459  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
18460  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18461  * else:
18462  */
18463  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18464  __pyx_v_to_object_func = __pyx_t_3;
18465 
18466  /* "View.MemoryView":1096
18467  * if isinstance(memview, _memoryviewslice):
18468  * to_object_func = (<_memoryviewslice> memview).to_object_func
18469  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
18470  * else:
18471  * to_object_func = NULL
18472  */
18473  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18474  __pyx_v_to_dtype_func = __pyx_t_4;
18475 
18476  /* "View.MemoryView":1094
18477  * cdef int (*to_dtype_func)(char *, object) except 0
18478  *
18479  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18480  * to_object_func = (<_memoryviewslice> memview).to_object_func
18481  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18482  */
18483  goto __pyx_L3;
18484  }
18485 
18486  /* "View.MemoryView":1098
18487  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18488  * else:
18489  * to_object_func = NULL # <<<<<<<<<<<<<<
18490  * to_dtype_func = NULL
18491  *
18492  */
18493  /*else*/ {
18494  __pyx_v_to_object_func = NULL;
18495 
18496  /* "View.MemoryView":1099
18497  * else:
18498  * to_object_func = NULL
18499  * to_dtype_func = NULL # <<<<<<<<<<<<<<
18500  *
18501  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18502  */
18503  __pyx_v_to_dtype_func = NULL;
18504  }
18505  __pyx_L3:;
18506 
18507  /* "View.MemoryView":1101
18508  * to_dtype_func = NULL
18509  *
18510  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
18511  * to_object_func, to_dtype_func,
18512  * memview.dtype_is_object)
18513  */
18514  __Pyx_XDECREF(__pyx_r);
18515 
18516  /* "View.MemoryView":1103
18517  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18518  * to_object_func, to_dtype_func,
18519  * memview.dtype_is_object) # <<<<<<<<<<<<<<
18520  *
18521  *
18522  */
18523  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1101, __pyx_L1_error)
18524  __Pyx_GOTREF(__pyx_t_5);
18525  __pyx_r = __pyx_t_5;
18526  __pyx_t_5 = 0;
18527  goto __pyx_L0;
18528 
18529  /* "View.MemoryView":1087
18530  *
18531  * @cname('__pyx_memoryview_copy_object_from_slice')
18532  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18533  * """
18534  * Create a new memoryview object from a given memoryview object and slice.
18535  */
18536 
18537  /* function exit code */
18538  __pyx_L1_error:;
18539  __Pyx_XDECREF(__pyx_t_5);
18540  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18541  __pyx_r = 0;
18542  __pyx_L0:;
18543  __Pyx_XGIVEREF(__pyx_r);
18544  __Pyx_RefNannyFinishContext();
18545  return __pyx_r;
18546 }
18547 
18548 /* "View.MemoryView":1109
18549  *
18550  *
18551  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18552  * if arg < 0:
18553  * return -arg
18554  */
18555 
18556 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18557  Py_ssize_t __pyx_r;
18558  int __pyx_t_1;
18559 
18560  /* "View.MemoryView":1110
18561  *
18562  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18563  * if arg < 0: # <<<<<<<<<<<<<<
18564  * return -arg
18565  * else:
18566  */
18567  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18568  if (__pyx_t_1) {
18569 
18570  /* "View.MemoryView":1111
18571  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18572  * if arg < 0:
18573  * return -arg # <<<<<<<<<<<<<<
18574  * else:
18575  * return arg
18576  */
18577  __pyx_r = (-__pyx_v_arg);
18578  goto __pyx_L0;
18579 
18580  /* "View.MemoryView":1110
18581  *
18582  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18583  * if arg < 0: # <<<<<<<<<<<<<<
18584  * return -arg
18585  * else:
18586  */
18587  }
18588 
18589  /* "View.MemoryView":1113
18590  * return -arg
18591  * else:
18592  * return arg # <<<<<<<<<<<<<<
18593  *
18594  * @cname('__pyx_get_best_slice_order')
18595  */
18596  /*else*/ {
18597  __pyx_r = __pyx_v_arg;
18598  goto __pyx_L0;
18599  }
18600 
18601  /* "View.MemoryView":1109
18602  *
18603  *
18604  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18605  * if arg < 0:
18606  * return -arg
18607  */
18608 
18609  /* function exit code */
18610  __pyx_L0:;
18611  return __pyx_r;
18612 }
18613 
18614 /* "View.MemoryView":1116
18615  *
18616  * @cname('__pyx_get_best_slice_order')
18617  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18618  * """
18619  * Figure out the best memory access order for a given slice.
18620  */
18621 
18622 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
18623  int __pyx_v_i;
18624  Py_ssize_t __pyx_v_c_stride;
18625  Py_ssize_t __pyx_v_f_stride;
18626  char __pyx_r;
18627  int __pyx_t_1;
18628  int __pyx_t_2;
18629  int __pyx_t_3;
18630  int __pyx_t_4;
18631 
18632  /* "View.MemoryView":1121
18633  * """
18634  * cdef int i
18635  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
18636  * cdef Py_ssize_t f_stride = 0
18637  *
18638  */
18639  __pyx_v_c_stride = 0;
18640 
18641  /* "View.MemoryView":1122
18642  * cdef int i
18643  * cdef Py_ssize_t c_stride = 0
18644  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
18645  *
18646  * for i in range(ndim - 1, -1, -1):
18647  */
18648  __pyx_v_f_stride = 0;
18649 
18650  /* "View.MemoryView":1124
18651  * cdef Py_ssize_t f_stride = 0
18652  *
18653  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18654  * if mslice.shape[i] > 1:
18655  * c_stride = mslice.strides[i]
18656  */
18657  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18658  __pyx_v_i = __pyx_t_1;
18659 
18660  /* "View.MemoryView":1125
18661  *
18662  * for i in range(ndim - 1, -1, -1):
18663  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18664  * c_stride = mslice.strides[i]
18665  * break
18666  */
18667  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18668  if (__pyx_t_2) {
18669 
18670  /* "View.MemoryView":1126
18671  * for i in range(ndim - 1, -1, -1):
18672  * if mslice.shape[i] > 1:
18673  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18674  * break
18675  *
18676  */
18677  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18678 
18679  /* "View.MemoryView":1127
18680  * if mslice.shape[i] > 1:
18681  * c_stride = mslice.strides[i]
18682  * break # <<<<<<<<<<<<<<
18683  *
18684  * for i in range(ndim):
18685  */
18686  goto __pyx_L4_break;
18687 
18688  /* "View.MemoryView":1125
18689  *
18690  * for i in range(ndim - 1, -1, -1):
18691  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18692  * c_stride = mslice.strides[i]
18693  * break
18694  */
18695  }
18696  }
18697  __pyx_L4_break:;
18698 
18699  /* "View.MemoryView":1129
18700  * break
18701  *
18702  * for i in range(ndim): # <<<<<<<<<<<<<<
18703  * if mslice.shape[i] > 1:
18704  * f_stride = mslice.strides[i]
18705  */
18706  __pyx_t_1 = __pyx_v_ndim;
18707  __pyx_t_3 = __pyx_t_1;
18708  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18709  __pyx_v_i = __pyx_t_4;
18710 
18711  /* "View.MemoryView":1130
18712  *
18713  * for i in range(ndim):
18714  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18715  * f_stride = mslice.strides[i]
18716  * break
18717  */
18718  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18719  if (__pyx_t_2) {
18720 
18721  /* "View.MemoryView":1131
18722  * for i in range(ndim):
18723  * if mslice.shape[i] > 1:
18724  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18725  * break
18726  *
18727  */
18728  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18729 
18730  /* "View.MemoryView":1132
18731  * if mslice.shape[i] > 1:
18732  * f_stride = mslice.strides[i]
18733  * break # <<<<<<<<<<<<<<
18734  *
18735  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18736  */
18737  goto __pyx_L7_break;
18738 
18739  /* "View.MemoryView":1130
18740  *
18741  * for i in range(ndim):
18742  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18743  * f_stride = mslice.strides[i]
18744  * break
18745  */
18746  }
18747  }
18748  __pyx_L7_break:;
18749 
18750  /* "View.MemoryView":1134
18751  * break
18752  *
18753  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18754  * return 'C'
18755  * else:
18756  */
18757  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18758  if (__pyx_t_2) {
18759 
18760  /* "View.MemoryView":1135
18761  *
18762  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18763  * return 'C' # <<<<<<<<<<<<<<
18764  * else:
18765  * return 'F'
18766  */
18767  __pyx_r = 'C';
18768  goto __pyx_L0;
18769 
18770  /* "View.MemoryView":1134
18771  * break
18772  *
18773  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18774  * return 'C'
18775  * else:
18776  */
18777  }
18778 
18779  /* "View.MemoryView":1137
18780  * return 'C'
18781  * else:
18782  * return 'F' # <<<<<<<<<<<<<<
18783  *
18784  * @cython.cdivision(True)
18785  */
18786  /*else*/ {
18787  __pyx_r = 'F';
18788  goto __pyx_L0;
18789  }
18790 
18791  /* "View.MemoryView":1116
18792  *
18793  * @cname('__pyx_get_best_slice_order')
18794  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18795  * """
18796  * Figure out the best memory access order for a given slice.
18797  */
18798 
18799  /* function exit code */
18800  __pyx_L0:;
18801  return __pyx_r;
18802 }
18803 
18804 /* "View.MemoryView":1140
18805  *
18806  * @cython.cdivision(True)
18807  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18808  * char *dst_data, Py_ssize_t *dst_strides,
18809  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18810  */
18811 
18812 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18813  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18814  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18815  Py_ssize_t __pyx_v_dst_extent;
18816  Py_ssize_t __pyx_v_src_stride;
18817  Py_ssize_t __pyx_v_dst_stride;
18818  int __pyx_t_1;
18819  int __pyx_t_2;
18820  int __pyx_t_3;
18821  Py_ssize_t __pyx_t_4;
18822  Py_ssize_t __pyx_t_5;
18823  Py_ssize_t __pyx_t_6;
18824 
18825  /* "View.MemoryView":1147
18826  *
18827  * cdef Py_ssize_t i
18828  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
18829  * cdef Py_ssize_t dst_extent = dst_shape[0]
18830  * cdef Py_ssize_t src_stride = src_strides[0]
18831  */
18832  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18833 
18834  /* "View.MemoryView":1148
18835  * cdef Py_ssize_t i
18836  * cdef Py_ssize_t src_extent = src_shape[0]
18837  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
18838  * cdef Py_ssize_t src_stride = src_strides[0]
18839  * cdef Py_ssize_t dst_stride = dst_strides[0]
18840  */
18841  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18842 
18843  /* "View.MemoryView":1149
18844  * cdef Py_ssize_t src_extent = src_shape[0]
18845  * cdef Py_ssize_t dst_extent = dst_shape[0]
18846  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
18847  * cdef Py_ssize_t dst_stride = dst_strides[0]
18848  *
18849  */
18850  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18851 
18852  /* "View.MemoryView":1150
18853  * cdef Py_ssize_t dst_extent = dst_shape[0]
18854  * cdef Py_ssize_t src_stride = src_strides[0]
18855  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
18856  *
18857  * if ndim == 1:
18858  */
18859  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18860 
18861  /* "View.MemoryView":1152
18862  * cdef Py_ssize_t dst_stride = dst_strides[0]
18863  *
18864  * if ndim == 1: # <<<<<<<<<<<<<<
18865  * if (src_stride > 0 and dst_stride > 0 and
18866  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18867  */
18868  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18869  if (__pyx_t_1) {
18870 
18871  /* "View.MemoryView":1153
18872  *
18873  * if ndim == 1:
18874  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18875  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18876  * memcpy(dst_data, src_data, itemsize * dst_extent)
18877  */
18878  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18879  if (__pyx_t_2) {
18880  } else {
18881  __pyx_t_1 = __pyx_t_2;
18882  goto __pyx_L5_bool_binop_done;
18883  }
18884  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18885  if (__pyx_t_2) {
18886  } else {
18887  __pyx_t_1 = __pyx_t_2;
18888  goto __pyx_L5_bool_binop_done;
18889  }
18890 
18891  /* "View.MemoryView":1154
18892  * if ndim == 1:
18893  * if (src_stride > 0 and dst_stride > 0 and
18894  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
18895  * memcpy(dst_data, src_data, itemsize * dst_extent)
18896  * else:
18897  */
18898  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18899  if (__pyx_t_2) {
18900  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18901  }
18902  __pyx_t_3 = (__pyx_t_2 != 0);
18903  __pyx_t_1 = __pyx_t_3;
18904  __pyx_L5_bool_binop_done:;
18905 
18906  /* "View.MemoryView":1153
18907  *
18908  * if ndim == 1:
18909  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18910  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18911  * memcpy(dst_data, src_data, itemsize * dst_extent)
18912  */
18913  if (__pyx_t_1) {
18914 
18915  /* "View.MemoryView":1155
18916  * if (src_stride > 0 and dst_stride > 0 and
18917  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18918  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
18919  * else:
18920  * for i in range(dst_extent):
18921  */
18922  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18923 
18924  /* "View.MemoryView":1153
18925  *
18926  * if ndim == 1:
18927  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18928  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18929  * memcpy(dst_data, src_data, itemsize * dst_extent)
18930  */
18931  goto __pyx_L4;
18932  }
18933 
18934  /* "View.MemoryView":1157
18935  * memcpy(dst_data, src_data, itemsize * dst_extent)
18936  * else:
18937  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18938  * memcpy(dst_data, src_data, itemsize)
18939  * src_data += src_stride
18940  */
18941  /*else*/ {
18942  __pyx_t_4 = __pyx_v_dst_extent;
18943  __pyx_t_5 = __pyx_t_4;
18944  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18945  __pyx_v_i = __pyx_t_6;
18946 
18947  /* "View.MemoryView":1158
18948  * else:
18949  * for i in range(dst_extent):
18950  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
18951  * src_data += src_stride
18952  * dst_data += dst_stride
18953  */
18954  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18955 
18956  /* "View.MemoryView":1159
18957  * for i in range(dst_extent):
18958  * memcpy(dst_data, src_data, itemsize)
18959  * src_data += src_stride # <<<<<<<<<<<<<<
18960  * dst_data += dst_stride
18961  * else:
18962  */
18963  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18964 
18965  /* "View.MemoryView":1160
18966  * memcpy(dst_data, src_data, itemsize)
18967  * src_data += src_stride
18968  * dst_data += dst_stride # <<<<<<<<<<<<<<
18969  * else:
18970  * for i in range(dst_extent):
18971  */
18972  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18973  }
18974  }
18975  __pyx_L4:;
18976 
18977  /* "View.MemoryView":1152
18978  * cdef Py_ssize_t dst_stride = dst_strides[0]
18979  *
18980  * if ndim == 1: # <<<<<<<<<<<<<<
18981  * if (src_stride > 0 and dst_stride > 0 and
18982  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18983  */
18984  goto __pyx_L3;
18985  }
18986 
18987  /* "View.MemoryView":1162
18988  * dst_data += dst_stride
18989  * else:
18990  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18991  * _copy_strided_to_strided(src_data, src_strides + 1,
18992  * dst_data, dst_strides + 1,
18993  */
18994  /*else*/ {
18995  __pyx_t_4 = __pyx_v_dst_extent;
18996  __pyx_t_5 = __pyx_t_4;
18997  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18998  __pyx_v_i = __pyx_t_6;
18999 
19000  /* "View.MemoryView":1163
19001  * else:
19002  * for i in range(dst_extent):
19003  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
19004  * dst_data, dst_strides + 1,
19005  * src_shape + 1, dst_shape + 1,
19006  */
19007  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
19008 
19009  /* "View.MemoryView":1167
19010  * src_shape + 1, dst_shape + 1,
19011  * ndim - 1, itemsize)
19012  * src_data += src_stride # <<<<<<<<<<<<<<
19013  * dst_data += dst_stride
19014  *
19015  */
19016  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19017 
19018  /* "View.MemoryView":1168
19019  * ndim - 1, itemsize)
19020  * src_data += src_stride
19021  * dst_data += dst_stride # <<<<<<<<<<<<<<
19022  *
19023  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
19024  */
19025  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19026  }
19027  }
19028  __pyx_L3:;
19029 
19030  /* "View.MemoryView":1140
19031  *
19032  * @cython.cdivision(True)
19033  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
19034  * char *dst_data, Py_ssize_t *dst_strides,
19035  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
19036  */
19037 
19038  /* function exit code */
19039 }
19040 
19041 /* "View.MemoryView":1170
19042  * dst_data += dst_stride
19043  *
19044  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19045  * __Pyx_memviewslice *dst,
19046  * int ndim, size_t itemsize) nogil:
19047  */
19048 
19049 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
19050 
19051  /* "View.MemoryView":1173
19052  * __Pyx_memviewslice *dst,
19053  * int ndim, size_t itemsize) nogil:
19054  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
19055  * src.shape, dst.shape, ndim, itemsize)
19056  *
19057  */
19058  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
19059 
19060  /* "View.MemoryView":1170
19061  * dst_data += dst_stride
19062  *
19063  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19064  * __Pyx_memviewslice *dst,
19065  * int ndim, size_t itemsize) nogil:
19066  */
19067 
19068  /* function exit code */
19069 }
19070 
19071 /* "View.MemoryView":1177
19072  *
19073  * @cname('__pyx_memoryview_slice_get_size')
19074  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19075  * "Return the size of the memory occupied by the slice in number of bytes"
19076  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19077  */
19078 
19079 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
19080  Py_ssize_t __pyx_v_shape;
19081  Py_ssize_t __pyx_v_size;
19082  Py_ssize_t __pyx_r;
19083  Py_ssize_t __pyx_t_1;
19084  Py_ssize_t *__pyx_t_2;
19085  Py_ssize_t *__pyx_t_3;
19086  Py_ssize_t *__pyx_t_4;
19087 
19088  /* "View.MemoryView":1179
19089  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
19090  * "Return the size of the memory occupied by the slice in number of bytes"
19091  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
19092  *
19093  * for shape in src.shape[:ndim]:
19094  */
19095  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19096  __pyx_v_size = __pyx_t_1;
19097 
19098  /* "View.MemoryView":1181
19099  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19100  *
19101  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
19102  * size *= shape
19103  *
19104  */
19105  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
19106  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
19107  __pyx_t_2 = __pyx_t_4;
19108  __pyx_v_shape = (__pyx_t_2[0]);
19109 
19110  /* "View.MemoryView":1182
19111  *
19112  * for shape in src.shape[:ndim]:
19113  * size *= shape # <<<<<<<<<<<<<<
19114  *
19115  * return size
19116  */
19117  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
19118  }
19119 
19120  /* "View.MemoryView":1184
19121  * size *= shape
19122  *
19123  * return size # <<<<<<<<<<<<<<
19124  *
19125  * @cname('__pyx_fill_contig_strides_array')
19126  */
19127  __pyx_r = __pyx_v_size;
19128  goto __pyx_L0;
19129 
19130  /* "View.MemoryView":1177
19131  *
19132  * @cname('__pyx_memoryview_slice_get_size')
19133  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19134  * "Return the size of the memory occupied by the slice in number of bytes"
19135  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19136  */
19137 
19138  /* function exit code */
19139  __pyx_L0:;
19140  return __pyx_r;
19141 }
19142 
19143 /* "View.MemoryView":1187
19144  *
19145  * @cname('__pyx_fill_contig_strides_array')
19146  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19147  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19148  * int ndim, char order) nogil:
19149  */
19150 
19151 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
19152  int __pyx_v_idx;
19153  Py_ssize_t __pyx_r;
19154  int __pyx_t_1;
19155  int __pyx_t_2;
19156  int __pyx_t_3;
19157  int __pyx_t_4;
19158 
19159  /* "View.MemoryView":1196
19160  * cdef int idx
19161  *
19162  * if order == 'F': # <<<<<<<<<<<<<<
19163  * for idx in range(ndim):
19164  * strides[idx] = stride
19165  */
19166  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
19167  if (__pyx_t_1) {
19168 
19169  /* "View.MemoryView":1197
19170  *
19171  * if order == 'F':
19172  * for idx in range(ndim): # <<<<<<<<<<<<<<
19173  * strides[idx] = stride
19174  * stride *= shape[idx]
19175  */
19176  __pyx_t_2 = __pyx_v_ndim;
19177  __pyx_t_3 = __pyx_t_2;
19178  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19179  __pyx_v_idx = __pyx_t_4;
19180 
19181  /* "View.MemoryView":1198
19182  * if order == 'F':
19183  * for idx in range(ndim):
19184  * strides[idx] = stride # <<<<<<<<<<<<<<
19185  * stride *= shape[idx]
19186  * else:
19187  */
19188  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19189 
19190  /* "View.MemoryView":1199
19191  * for idx in range(ndim):
19192  * strides[idx] = stride
19193  * stride *= shape[idx] # <<<<<<<<<<<<<<
19194  * else:
19195  * for idx in range(ndim - 1, -1, -1):
19196  */
19197  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19198  }
19199 
19200  /* "View.MemoryView":1196
19201  * cdef int idx
19202  *
19203  * if order == 'F': # <<<<<<<<<<<<<<
19204  * for idx in range(ndim):
19205  * strides[idx] = stride
19206  */
19207  goto __pyx_L3;
19208  }
19209 
19210  /* "View.MemoryView":1201
19211  * stride *= shape[idx]
19212  * else:
19213  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19214  * strides[idx] = stride
19215  * stride *= shape[idx]
19216  */
19217  /*else*/ {
19218  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19219  __pyx_v_idx = __pyx_t_2;
19220 
19221  /* "View.MemoryView":1202
19222  * else:
19223  * for idx in range(ndim - 1, -1, -1):
19224  * strides[idx] = stride # <<<<<<<<<<<<<<
19225  * stride *= shape[idx]
19226  *
19227  */
19228  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19229 
19230  /* "View.MemoryView":1203
19231  * for idx in range(ndim - 1, -1, -1):
19232  * strides[idx] = stride
19233  * stride *= shape[idx] # <<<<<<<<<<<<<<
19234  *
19235  * return stride
19236  */
19237  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19238  }
19239  }
19240  __pyx_L3:;
19241 
19242  /* "View.MemoryView":1205
19243  * stride *= shape[idx]
19244  *
19245  * return stride # <<<<<<<<<<<<<<
19246  *
19247  * @cname('__pyx_memoryview_copy_data_to_temp')
19248  */
19249  __pyx_r = __pyx_v_stride;
19250  goto __pyx_L0;
19251 
19252  /* "View.MemoryView":1187
19253  *
19254  * @cname('__pyx_fill_contig_strides_array')
19255  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19256  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19257  * int ndim, char order) nogil:
19258  */
19259 
19260  /* function exit code */
19261  __pyx_L0:;
19262  return __pyx_r;
19263 }
19264 
19265 /* "View.MemoryView":1208
19266  *
19267  * @cname('__pyx_memoryview_copy_data_to_temp')
19268  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19269  * __Pyx_memviewslice *tmpslice,
19270  * char order,
19271  */
19272 
19273 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
19274  int __pyx_v_i;
19275  void *__pyx_v_result;
19276  size_t __pyx_v_itemsize;
19277  size_t __pyx_v_size;
19278  void *__pyx_r;
19279  Py_ssize_t __pyx_t_1;
19280  int __pyx_t_2;
19281  int __pyx_t_3;
19282  struct __pyx_memoryview_obj *__pyx_t_4;
19283  int __pyx_t_5;
19284  int __pyx_t_6;
19285  int __pyx_lineno = 0;
19286  const char *__pyx_filename = NULL;
19287  int __pyx_clineno = 0;
19288 
19289  /* "View.MemoryView":1219
19290  * cdef void *result
19291  *
19292  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19293  * cdef size_t size = slice_get_size(src, ndim)
19294  *
19295  */
19296  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19297  __pyx_v_itemsize = __pyx_t_1;
19298 
19299  /* "View.MemoryView":1220
19300  *
19301  * cdef size_t itemsize = src.memview.view.itemsize
19302  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
19303  *
19304  * result = malloc(size)
19305  */
19306  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19307 
19308  /* "View.MemoryView":1222
19309  * cdef size_t size = slice_get_size(src, ndim)
19310  *
19311  * result = malloc(size) # <<<<<<<<<<<<<<
19312  * if not result:
19313  * _err(MemoryError, NULL)
19314  */
19315  __pyx_v_result = malloc(__pyx_v_size);
19316 
19317  /* "View.MemoryView":1223
19318  *
19319  * result = malloc(size)
19320  * if not result: # <<<<<<<<<<<<<<
19321  * _err(MemoryError, NULL)
19322  *
19323  */
19324  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19325  if (__pyx_t_2) {
19326 
19327  /* "View.MemoryView":1224
19328  * result = malloc(size)
19329  * if not result:
19330  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
19331  *
19332  *
19333  */
19334  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1224, __pyx_L1_error)
19335 
19336  /* "View.MemoryView":1223
19337  *
19338  * result = malloc(size)
19339  * if not result: # <<<<<<<<<<<<<<
19340  * _err(MemoryError, NULL)
19341  *
19342  */
19343  }
19344 
19345  /* "View.MemoryView":1227
19346  *
19347  *
19348  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
19349  * tmpslice.memview = src.memview
19350  * for i in range(ndim):
19351  */
19352  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
19353 
19354  /* "View.MemoryView":1228
19355  *
19356  * tmpslice.data = <char *> result
19357  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
19358  * for i in range(ndim):
19359  * tmpslice.shape[i] = src.shape[i]
19360  */
19361  __pyx_t_4 = __pyx_v_src->memview;
19362  __pyx_v_tmpslice->memview = __pyx_t_4;
19363 
19364  /* "View.MemoryView":1229
19365  * tmpslice.data = <char *> result
19366  * tmpslice.memview = src.memview
19367  * for i in range(ndim): # <<<<<<<<<<<<<<
19368  * tmpslice.shape[i] = src.shape[i]
19369  * tmpslice.suboffsets[i] = -1
19370  */
19371  __pyx_t_3 = __pyx_v_ndim;
19372  __pyx_t_5 = __pyx_t_3;
19373  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19374  __pyx_v_i = __pyx_t_6;
19375 
19376  /* "View.MemoryView":1230
19377  * tmpslice.memview = src.memview
19378  * for i in range(ndim):
19379  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
19380  * tmpslice.suboffsets[i] = -1
19381  *
19382  */
19383  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19384 
19385  /* "View.MemoryView":1231
19386  * for i in range(ndim):
19387  * tmpslice.shape[i] = src.shape[i]
19388  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19389  *
19390  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
19391  */
19392  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
19393  }
19394 
19395  /* "View.MemoryView":1233
19396  * tmpslice.suboffsets[i] = -1
19397  *
19398  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
19399  * ndim, order)
19400  *
19401  */
19402  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
19403 
19404  /* "View.MemoryView":1237
19405  *
19406  *
19407  * for i in range(ndim): # <<<<<<<<<<<<<<
19408  * if tmpslice.shape[i] == 1:
19409  * tmpslice.strides[i] = 0
19410  */
19411  __pyx_t_3 = __pyx_v_ndim;
19412  __pyx_t_5 = __pyx_t_3;
19413  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19414  __pyx_v_i = __pyx_t_6;
19415 
19416  /* "View.MemoryView":1238
19417  *
19418  * for i in range(ndim):
19419  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19420  * tmpslice.strides[i] = 0
19421  *
19422  */
19423  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19424  if (__pyx_t_2) {
19425 
19426  /* "View.MemoryView":1239
19427  * for i in range(ndim):
19428  * if tmpslice.shape[i] == 1:
19429  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
19430  *
19431  * if slice_is_contig(src[0], order, ndim):
19432  */
19433  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19434 
19435  /* "View.MemoryView":1238
19436  *
19437  * for i in range(ndim):
19438  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19439  * tmpslice.strides[i] = 0
19440  *
19441  */
19442  }
19443  }
19444 
19445  /* "View.MemoryView":1241
19446  * tmpslice.strides[i] = 0
19447  *
19448  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19449  * memcpy(result, src.data, size)
19450  * else:
19451  */
19452  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19453  if (__pyx_t_2) {
19454 
19455  /* "View.MemoryView":1242
19456  *
19457  * if slice_is_contig(src[0], order, ndim):
19458  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
19459  * else:
19460  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19461  */
19462  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19463 
19464  /* "View.MemoryView":1241
19465  * tmpslice.strides[i] = 0
19466  *
19467  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19468  * memcpy(result, src.data, size)
19469  * else:
19470  */
19471  goto __pyx_L9;
19472  }
19473 
19474  /* "View.MemoryView":1244
19475  * memcpy(result, src.data, size)
19476  * else:
19477  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
19478  *
19479  * return result
19480  */
19481  /*else*/ {
19482  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19483  }
19484  __pyx_L9:;
19485 
19486  /* "View.MemoryView":1246
19487  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19488  *
19489  * return result # <<<<<<<<<<<<<<
19490  *
19491  *
19492  */
19493  __pyx_r = __pyx_v_result;
19494  goto __pyx_L0;
19495 
19496  /* "View.MemoryView":1208
19497  *
19498  * @cname('__pyx_memoryview_copy_data_to_temp')
19499  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19500  * __Pyx_memviewslice *tmpslice,
19501  * char order,
19502  */
19503 
19504  /* function exit code */
19505  __pyx_L1_error:;
19506  {
19507  #ifdef WITH_THREAD
19508  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19509  #endif
19510  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19511  #ifdef WITH_THREAD
19512  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19513  #endif
19514  }
19515  __pyx_r = NULL;
19516  __pyx_L0:;
19517  return __pyx_r;
19518 }
19519 
19520 /* "View.MemoryView":1251
19521  *
19522  * @cname('__pyx_memoryview_err_extents')
19523  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19524  * Py_ssize_t extent2) except -1 with gil:
19525  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19526  */
19527 
19528 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19529  int __pyx_r;
19530  __Pyx_RefNannyDeclarations
19531  PyObject *__pyx_t_1 = NULL;
19532  PyObject *__pyx_t_2 = NULL;
19533  PyObject *__pyx_t_3 = NULL;
19534  PyObject *__pyx_t_4 = NULL;
19535  int __pyx_lineno = 0;
19536  const char *__pyx_filename = NULL;
19537  int __pyx_clineno = 0;
19538  #ifdef WITH_THREAD
19539  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19540  #endif
19541  __Pyx_RefNannySetupContext("_err_extents", 0);
19542 
19543  /* "View.MemoryView":1254
19544  * Py_ssize_t extent2) except -1 with gil:
19545  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19546  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
19547  *
19548  * @cname('__pyx_memoryview_err_dim')
19549  */
19550  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error)
19551  __Pyx_GOTREF(__pyx_t_1);
19552  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1254, __pyx_L1_error)
19553  __Pyx_GOTREF(__pyx_t_2);
19554  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1254, __pyx_L1_error)
19555  __Pyx_GOTREF(__pyx_t_3);
19556  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1254, __pyx_L1_error)
19557  __Pyx_GOTREF(__pyx_t_4);
19558  __Pyx_GIVEREF(__pyx_t_1);
19559  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19560  __Pyx_GIVEREF(__pyx_t_2);
19561  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19562  __Pyx_GIVEREF(__pyx_t_3);
19563  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19564  __pyx_t_1 = 0;
19565  __pyx_t_2 = 0;
19566  __pyx_t_3 = 0;
19567 
19568  /* "View.MemoryView":1253
19569  * cdef int _err_extents(int i, Py_ssize_t extent1,
19570  * Py_ssize_t extent2) except -1 with gil:
19571  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
19572  * (i, extent1, extent2))
19573  *
19574  */
19575  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1253, __pyx_L1_error)
19576  __Pyx_GOTREF(__pyx_t_3);
19577  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19578  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1253, __pyx_L1_error)
19579  __Pyx_GOTREF(__pyx_t_4);
19580  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19581  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19582  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19583  __PYX_ERR(2, 1253, __pyx_L1_error)
19584 
19585  /* "View.MemoryView":1251
19586  *
19587  * @cname('__pyx_memoryview_err_extents')
19588  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19589  * Py_ssize_t extent2) except -1 with gil:
19590  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19591  */
19592 
19593  /* function exit code */
19594  __pyx_L1_error:;
19595  __Pyx_XDECREF(__pyx_t_1);
19596  __Pyx_XDECREF(__pyx_t_2);
19597  __Pyx_XDECREF(__pyx_t_3);
19598  __Pyx_XDECREF(__pyx_t_4);
19599  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19600  __pyx_r = -1;
19601  __Pyx_RefNannyFinishContext();
19602  #ifdef WITH_THREAD
19603  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19604  #endif
19605  return __pyx_r;
19606 }
19607 
19608 /* "View.MemoryView":1257
19609  *
19610  * @cname('__pyx_memoryview_err_dim')
19611  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19612  * raise error(msg.decode('ascii') % dim)
19613  *
19614  */
19615 
19616 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
19617  int __pyx_r;
19618  __Pyx_RefNannyDeclarations
19619  PyObject *__pyx_t_1 = NULL;
19620  PyObject *__pyx_t_2 = NULL;
19621  PyObject *__pyx_t_3 = NULL;
19622  PyObject *__pyx_t_4 = NULL;
19623  int __pyx_lineno = 0;
19624  const char *__pyx_filename = NULL;
19625  int __pyx_clineno = 0;
19626  #ifdef WITH_THREAD
19627  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19628  #endif
19629  __Pyx_RefNannySetupContext("_err_dim", 0);
19630  __Pyx_INCREF(__pyx_v_error);
19631 
19632  /* "View.MemoryView":1258
19633  * @cname('__pyx_memoryview_err_dim')
19634  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
19635  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
19636  *
19637  * @cname('__pyx_memoryview_err')
19638  */
19639  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1258, __pyx_L1_error)
19640  __Pyx_GOTREF(__pyx_t_2);
19641  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1258, __pyx_L1_error)
19642  __Pyx_GOTREF(__pyx_t_3);
19643  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1258, __pyx_L1_error)
19644  __Pyx_GOTREF(__pyx_t_4);
19645  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19646  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19647  __Pyx_INCREF(__pyx_v_error);
19648  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19649  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19650  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19651  if (likely(__pyx_t_2)) {
19652  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19653  __Pyx_INCREF(__pyx_t_2);
19654  __Pyx_INCREF(function);
19655  __Pyx_DECREF_SET(__pyx_t_3, function);
19656  }
19657  }
19658  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
19659  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19660  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19661  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1258, __pyx_L1_error)
19662  __Pyx_GOTREF(__pyx_t_1);
19663  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19664  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19665  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19666  __PYX_ERR(2, 1258, __pyx_L1_error)
19667 
19668  /* "View.MemoryView":1257
19669  *
19670  * @cname('__pyx_memoryview_err_dim')
19671  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19672  * raise error(msg.decode('ascii') % dim)
19673  *
19674  */
19675 
19676  /* function exit code */
19677  __pyx_L1_error:;
19678  __Pyx_XDECREF(__pyx_t_1);
19679  __Pyx_XDECREF(__pyx_t_2);
19680  __Pyx_XDECREF(__pyx_t_3);
19681  __Pyx_XDECREF(__pyx_t_4);
19682  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19683  __pyx_r = -1;
19684  __Pyx_XDECREF(__pyx_v_error);
19685  __Pyx_RefNannyFinishContext();
19686  #ifdef WITH_THREAD
19687  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19688  #endif
19689  return __pyx_r;
19690 }
19691 
19692 /* "View.MemoryView":1261
19693  *
19694  * @cname('__pyx_memoryview_err')
19695  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19696  * if msg != NULL:
19697  * raise error(msg.decode('ascii'))
19698  */
19699 
19700 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
19701  int __pyx_r;
19702  __Pyx_RefNannyDeclarations
19703  int __pyx_t_1;
19704  PyObject *__pyx_t_2 = NULL;
19705  PyObject *__pyx_t_3 = NULL;
19706  PyObject *__pyx_t_4 = NULL;
19707  PyObject *__pyx_t_5 = NULL;
19708  int __pyx_lineno = 0;
19709  const char *__pyx_filename = NULL;
19710  int __pyx_clineno = 0;
19711  #ifdef WITH_THREAD
19712  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19713  #endif
19714  __Pyx_RefNannySetupContext("_err", 0);
19715  __Pyx_INCREF(__pyx_v_error);
19716 
19717  /* "View.MemoryView":1262
19718  * @cname('__pyx_memoryview_err')
19719  * cdef int _err(object error, char *msg) except -1 with gil:
19720  * if msg != NULL: # <<<<<<<<<<<<<<
19721  * raise error(msg.decode('ascii'))
19722  * else:
19723  */
19724  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19725  if (unlikely(__pyx_t_1)) {
19726 
19727  /* "View.MemoryView":1263
19728  * cdef int _err(object error, char *msg) except -1 with gil:
19729  * if msg != NULL:
19730  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
19731  * else:
19732  * raise error
19733  */
19734  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1263, __pyx_L1_error)
19735  __Pyx_GOTREF(__pyx_t_3);
19736  __Pyx_INCREF(__pyx_v_error);
19737  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19738  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19739  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19740  if (likely(__pyx_t_5)) {
19741  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
19742  __Pyx_INCREF(__pyx_t_5);
19743  __Pyx_INCREF(function);
19744  __Pyx_DECREF_SET(__pyx_t_4, function);
19745  }
19746  }
19747  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
19748  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19749  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19750  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1263, __pyx_L1_error)
19751  __Pyx_GOTREF(__pyx_t_2);
19752  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19753  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19754  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19755  __PYX_ERR(2, 1263, __pyx_L1_error)
19756 
19757  /* "View.MemoryView":1262
19758  * @cname('__pyx_memoryview_err')
19759  * cdef int _err(object error, char *msg) except -1 with gil:
19760  * if msg != NULL: # <<<<<<<<<<<<<<
19761  * raise error(msg.decode('ascii'))
19762  * else:
19763  */
19764  }
19765 
19766  /* "View.MemoryView":1265
19767  * raise error(msg.decode('ascii'))
19768  * else:
19769  * raise error # <<<<<<<<<<<<<<
19770  *
19771  * @cname('__pyx_memoryview_copy_contents')
19772  */
19773  /*else*/ {
19774  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19775  __PYX_ERR(2, 1265, __pyx_L1_error)
19776  }
19777 
19778  /* "View.MemoryView":1261
19779  *
19780  * @cname('__pyx_memoryview_err')
19781  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19782  * if msg != NULL:
19783  * raise error(msg.decode('ascii'))
19784  */
19785 
19786  /* function exit code */
19787  __pyx_L1_error:;
19788  __Pyx_XDECREF(__pyx_t_2);
19789  __Pyx_XDECREF(__pyx_t_3);
19790  __Pyx_XDECREF(__pyx_t_4);
19791  __Pyx_XDECREF(__pyx_t_5);
19792  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19793  __pyx_r = -1;
19794  __Pyx_XDECREF(__pyx_v_error);
19795  __Pyx_RefNannyFinishContext();
19796  #ifdef WITH_THREAD
19797  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19798  #endif
19799  return __pyx_r;
19800 }
19801 
19802 /* "View.MemoryView":1268
19803  *
19804  * @cname('__pyx_memoryview_copy_contents')
19805  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19806  * __Pyx_memviewslice dst,
19807  * int src_ndim, int dst_ndim,
19808  */
19809 
19810 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
19811  void *__pyx_v_tmpdata;
19812  size_t __pyx_v_itemsize;
19813  int __pyx_v_i;
19814  char __pyx_v_order;
19815  int __pyx_v_broadcasting;
19816  int __pyx_v_direct_copy;
19817  __Pyx_memviewslice __pyx_v_tmp;
19818  int __pyx_v_ndim;
19819  int __pyx_r;
19820  Py_ssize_t __pyx_t_1;
19821  int __pyx_t_2;
19822  int __pyx_t_3;
19823  int __pyx_t_4;
19824  int __pyx_t_5;
19825  int __pyx_t_6;
19826  void *__pyx_t_7;
19827  int __pyx_t_8;
19828  int __pyx_lineno = 0;
19829  const char *__pyx_filename = NULL;
19830  int __pyx_clineno = 0;
19831 
19832  /* "View.MemoryView":1276
19833  * Check for overlapping memory and verify the shapes.
19834  * """
19835  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
19836  * cdef size_t itemsize = src.memview.view.itemsize
19837  * cdef int i
19838  */
19839  __pyx_v_tmpdata = NULL;
19840 
19841  /* "View.MemoryView":1277
19842  * """
19843  * cdef void *tmpdata = NULL
19844  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19845  * cdef int i
19846  * cdef char order = get_best_order(&src, src_ndim)
19847  */
19848  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19849  __pyx_v_itemsize = __pyx_t_1;
19850 
19851  /* "View.MemoryView":1279
19852  * cdef size_t itemsize = src.memview.view.itemsize
19853  * cdef int i
19854  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
19855  * cdef bint broadcasting = False
19856  * cdef bint direct_copy = False
19857  */
19858  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19859 
19860  /* "View.MemoryView":1280
19861  * cdef int i
19862  * cdef char order = get_best_order(&src, src_ndim)
19863  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
19864  * cdef bint direct_copy = False
19865  * cdef __Pyx_memviewslice tmp
19866  */
19867  __pyx_v_broadcasting = 0;
19868 
19869  /* "View.MemoryView":1281
19870  * cdef char order = get_best_order(&src, src_ndim)
19871  * cdef bint broadcasting = False
19872  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
19873  * cdef __Pyx_memviewslice tmp
19874  *
19875  */
19876  __pyx_v_direct_copy = 0;
19877 
19878  /* "View.MemoryView":1284
19879  * cdef __Pyx_memviewslice tmp
19880  *
19881  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19882  * broadcast_leading(&src, src_ndim, dst_ndim)
19883  * elif dst_ndim < src_ndim:
19884  */
19885  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19886  if (__pyx_t_2) {
19887 
19888  /* "View.MemoryView":1285
19889  *
19890  * if src_ndim < dst_ndim:
19891  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19892  * elif dst_ndim < src_ndim:
19893  * broadcast_leading(&dst, dst_ndim, src_ndim)
19894  */
19895  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19896 
19897  /* "View.MemoryView":1284
19898  * cdef __Pyx_memviewslice tmp
19899  *
19900  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19901  * broadcast_leading(&src, src_ndim, dst_ndim)
19902  * elif dst_ndim < src_ndim:
19903  */
19904  goto __pyx_L3;
19905  }
19906 
19907  /* "View.MemoryView":1286
19908  * if src_ndim < dst_ndim:
19909  * broadcast_leading(&src, src_ndim, dst_ndim)
19910  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19911  * broadcast_leading(&dst, dst_ndim, src_ndim)
19912  *
19913  */
19914  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19915  if (__pyx_t_2) {
19916 
19917  /* "View.MemoryView":1287
19918  * broadcast_leading(&src, src_ndim, dst_ndim)
19919  * elif dst_ndim < src_ndim:
19920  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
19921  *
19922  * cdef int ndim = max(src_ndim, dst_ndim)
19923  */
19924  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19925 
19926  /* "View.MemoryView":1286
19927  * if src_ndim < dst_ndim:
19928  * broadcast_leading(&src, src_ndim, dst_ndim)
19929  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19930  * broadcast_leading(&dst, dst_ndim, src_ndim)
19931  *
19932  */
19933  }
19934  __pyx_L3:;
19935 
19936  /* "View.MemoryView":1289
19937  * broadcast_leading(&dst, dst_ndim, src_ndim)
19938  *
19939  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19940  *
19941  * for i in range(ndim):
19942  */
19943  __pyx_t_3 = __pyx_v_dst_ndim;
19944  __pyx_t_4 = __pyx_v_src_ndim;
19945  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19946  __pyx_t_5 = __pyx_t_3;
19947  } else {
19948  __pyx_t_5 = __pyx_t_4;
19949  }
19950  __pyx_v_ndim = __pyx_t_5;
19951 
19952  /* "View.MemoryView":1291
19953  * cdef int ndim = max(src_ndim, dst_ndim)
19954  *
19955  * for i in range(ndim): # <<<<<<<<<<<<<<
19956  * if src.shape[i] != dst.shape[i]:
19957  * if src.shape[i] == 1:
19958  */
19959  __pyx_t_5 = __pyx_v_ndim;
19960  __pyx_t_3 = __pyx_t_5;
19961  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19962  __pyx_v_i = __pyx_t_4;
19963 
19964  /* "View.MemoryView":1292
19965  *
19966  * for i in range(ndim):
19967  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19968  * if src.shape[i] == 1:
19969  * broadcasting = True
19970  */
19971  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19972  if (__pyx_t_2) {
19973 
19974  /* "View.MemoryView":1293
19975  * for i in range(ndim):
19976  * if src.shape[i] != dst.shape[i]:
19977  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19978  * broadcasting = True
19979  * src.strides[i] = 0
19980  */
19981  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19982  if (__pyx_t_2) {
19983 
19984  /* "View.MemoryView":1294
19985  * if src.shape[i] != dst.shape[i]:
19986  * if src.shape[i] == 1:
19987  * broadcasting = True # <<<<<<<<<<<<<<
19988  * src.strides[i] = 0
19989  * else:
19990  */
19991  __pyx_v_broadcasting = 1;
19992 
19993  /* "View.MemoryView":1295
19994  * if src.shape[i] == 1:
19995  * broadcasting = True
19996  * src.strides[i] = 0 # <<<<<<<<<<<<<<
19997  * else:
19998  * _err_extents(i, dst.shape[i], src.shape[i])
19999  */
20000  (__pyx_v_src.strides[__pyx_v_i]) = 0;
20001 
20002  /* "View.MemoryView":1293
20003  * for i in range(ndim):
20004  * if src.shape[i] != dst.shape[i]:
20005  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
20006  * broadcasting = True
20007  * src.strides[i] = 0
20008  */
20009  goto __pyx_L7;
20010  }
20011 
20012  /* "View.MemoryView":1297
20013  * src.strides[i] = 0
20014  * else:
20015  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
20016  *
20017  * if src.suboffsets[i] >= 0:
20018  */
20019  /*else*/ {
20020  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1297, __pyx_L1_error)
20021  }
20022  __pyx_L7:;
20023 
20024  /* "View.MemoryView":1292
20025  *
20026  * for i in range(ndim):
20027  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
20028  * if src.shape[i] == 1:
20029  * broadcasting = True
20030  */
20031  }
20032 
20033  /* "View.MemoryView":1299
20034  * _err_extents(i, dst.shape[i], src.shape[i])
20035  *
20036  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20037  * _err_dim(ValueError, "Dimension %d is not direct", i)
20038  *
20039  */
20040  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
20041  if (__pyx_t_2) {
20042 
20043  /* "View.MemoryView":1300
20044  *
20045  * if src.suboffsets[i] >= 0:
20046  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
20047  *
20048  * if slices_overlap(&src, &dst, ndim, itemsize):
20049  */
20050  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1300, __pyx_L1_error)
20051 
20052  /* "View.MemoryView":1299
20053  * _err_extents(i, dst.shape[i], src.shape[i])
20054  *
20055  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20056  * _err_dim(ValueError, "Dimension %d is not direct", i)
20057  *
20058  */
20059  }
20060  }
20061 
20062  /* "View.MemoryView":1302
20063  * _err_dim(ValueError, "Dimension %d is not direct", i)
20064  *
20065  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20066  *
20067  * if not slice_is_contig(src, order, ndim):
20068  */
20069  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
20070  if (__pyx_t_2) {
20071 
20072  /* "View.MemoryView":1304
20073  * if slices_overlap(&src, &dst, ndim, itemsize):
20074  *
20075  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20076  * order = get_best_order(&dst, ndim)
20077  *
20078  */
20079  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
20080  if (__pyx_t_2) {
20081 
20082  /* "View.MemoryView":1305
20083  *
20084  * if not slice_is_contig(src, order, ndim):
20085  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
20086  *
20087  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20088  */
20089  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
20090 
20091  /* "View.MemoryView":1304
20092  * if slices_overlap(&src, &dst, ndim, itemsize):
20093  *
20094  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20095  * order = get_best_order(&dst, ndim)
20096  *
20097  */
20098  }
20099 
20100  /* "View.MemoryView":1307
20101  * order = get_best_order(&dst, ndim)
20102  *
20103  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
20104  * src = tmp
20105  *
20106  */
20107  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1307, __pyx_L1_error)
20108  __pyx_v_tmpdata = __pyx_t_7;
20109 
20110  /* "View.MemoryView":1308
20111  *
20112  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20113  * src = tmp # <<<<<<<<<<<<<<
20114  *
20115  * if not broadcasting:
20116  */
20117  __pyx_v_src = __pyx_v_tmp;
20118 
20119  /* "View.MemoryView":1302
20120  * _err_dim(ValueError, "Dimension %d is not direct", i)
20121  *
20122  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20123  *
20124  * if not slice_is_contig(src, order, ndim):
20125  */
20126  }
20127 
20128  /* "View.MemoryView":1310
20129  * src = tmp
20130  *
20131  * if not broadcasting: # <<<<<<<<<<<<<<
20132  *
20133  *
20134  */
20135  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20136  if (__pyx_t_2) {
20137 
20138  /* "View.MemoryView":1313
20139  *
20140  *
20141  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20142  * direct_copy = slice_is_contig(dst, 'C', ndim)
20143  * elif slice_is_contig(src, 'F', ndim):
20144  */
20145  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
20146  if (__pyx_t_2) {
20147 
20148  /* "View.MemoryView":1314
20149  *
20150  * if slice_is_contig(src, 'C', ndim):
20151  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
20152  * elif slice_is_contig(src, 'F', ndim):
20153  * direct_copy = slice_is_contig(dst, 'F', ndim)
20154  */
20155  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
20156 
20157  /* "View.MemoryView":1313
20158  *
20159  *
20160  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20161  * direct_copy = slice_is_contig(dst, 'C', ndim)
20162  * elif slice_is_contig(src, 'F', ndim):
20163  */
20164  goto __pyx_L12;
20165  }
20166 
20167  /* "View.MemoryView":1315
20168  * if slice_is_contig(src, 'C', ndim):
20169  * direct_copy = slice_is_contig(dst, 'C', ndim)
20170  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20171  * direct_copy = slice_is_contig(dst, 'F', ndim)
20172  *
20173  */
20174  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
20175  if (__pyx_t_2) {
20176 
20177  /* "View.MemoryView":1316
20178  * direct_copy = slice_is_contig(dst, 'C', ndim)
20179  * elif slice_is_contig(src, 'F', ndim):
20180  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
20181  *
20182  * if direct_copy:
20183  */
20184  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
20185 
20186  /* "View.MemoryView":1315
20187  * if slice_is_contig(src, 'C', ndim):
20188  * direct_copy = slice_is_contig(dst, 'C', ndim)
20189  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20190  * direct_copy = slice_is_contig(dst, 'F', ndim)
20191  *
20192  */
20193  }
20194  __pyx_L12:;
20195 
20196  /* "View.MemoryView":1318
20197  * direct_copy = slice_is_contig(dst, 'F', ndim)
20198  *
20199  * if direct_copy: # <<<<<<<<<<<<<<
20200  *
20201  * refcount_copying(&dst, dtype_is_object, ndim, False)
20202  */
20203  __pyx_t_2 = (__pyx_v_direct_copy != 0);
20204  if (__pyx_t_2) {
20205 
20206  /* "View.MemoryView":1320
20207  * if direct_copy:
20208  *
20209  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20210  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20211  * refcount_copying(&dst, dtype_is_object, ndim, True)
20212  */
20213  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20214 
20215  /* "View.MemoryView":1321
20216  *
20217  * refcount_copying(&dst, dtype_is_object, ndim, False)
20218  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
20219  * refcount_copying(&dst, dtype_is_object, ndim, True)
20220  * free(tmpdata)
20221  */
20222  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20223 
20224  /* "View.MemoryView":1322
20225  * refcount_copying(&dst, dtype_is_object, ndim, False)
20226  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20227  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20228  * free(tmpdata)
20229  * return 0
20230  */
20231  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20232 
20233  /* "View.MemoryView":1323
20234  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20235  * refcount_copying(&dst, dtype_is_object, ndim, True)
20236  * free(tmpdata) # <<<<<<<<<<<<<<
20237  * return 0
20238  *
20239  */
20240  free(__pyx_v_tmpdata);
20241 
20242  /* "View.MemoryView":1324
20243  * refcount_copying(&dst, dtype_is_object, ndim, True)
20244  * free(tmpdata)
20245  * return 0 # <<<<<<<<<<<<<<
20246  *
20247  * if order == 'F' == get_best_order(&dst, ndim):
20248  */
20249  __pyx_r = 0;
20250  goto __pyx_L0;
20251 
20252  /* "View.MemoryView":1318
20253  * direct_copy = slice_is_contig(dst, 'F', ndim)
20254  *
20255  * if direct_copy: # <<<<<<<<<<<<<<
20256  *
20257  * refcount_copying(&dst, dtype_is_object, ndim, False)
20258  */
20259  }
20260 
20261  /* "View.MemoryView":1310
20262  * src = tmp
20263  *
20264  * if not broadcasting: # <<<<<<<<<<<<<<
20265  *
20266  *
20267  */
20268  }
20269 
20270  /* "View.MemoryView":1326
20271  * return 0
20272  *
20273  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20274  *
20275  *
20276  */
20277  __pyx_t_2 = (__pyx_v_order == 'F');
20278  if (__pyx_t_2) {
20279  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20280  }
20281  __pyx_t_8 = (__pyx_t_2 != 0);
20282  if (__pyx_t_8) {
20283 
20284  /* "View.MemoryView":1329
20285  *
20286  *
20287  * transpose_memslice(&src) # <<<<<<<<<<<<<<
20288  * transpose_memslice(&dst)
20289  *
20290  */
20291  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1329, __pyx_L1_error)
20292 
20293  /* "View.MemoryView":1330
20294  *
20295  * transpose_memslice(&src)
20296  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
20297  *
20298  * refcount_copying(&dst, dtype_is_object, ndim, False)
20299  */
20300  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1330, __pyx_L1_error)
20301 
20302  /* "View.MemoryView":1326
20303  * return 0
20304  *
20305  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20306  *
20307  *
20308  */
20309  }
20310 
20311  /* "View.MemoryView":1332
20312  * transpose_memslice(&dst)
20313  *
20314  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20315  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20316  * refcount_copying(&dst, dtype_is_object, ndim, True)
20317  */
20318  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20319 
20320  /* "View.MemoryView":1333
20321  *
20322  * refcount_copying(&dst, dtype_is_object, ndim, False)
20323  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
20324  * refcount_copying(&dst, dtype_is_object, ndim, True)
20325  *
20326  */
20327  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20328 
20329  /* "View.MemoryView":1334
20330  * refcount_copying(&dst, dtype_is_object, ndim, False)
20331  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20332  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20333  *
20334  * free(tmpdata)
20335  */
20336  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20337 
20338  /* "View.MemoryView":1336
20339  * refcount_copying(&dst, dtype_is_object, ndim, True)
20340  *
20341  * free(tmpdata) # <<<<<<<<<<<<<<
20342  * return 0
20343  *
20344  */
20345  free(__pyx_v_tmpdata);
20346 
20347  /* "View.MemoryView":1337
20348  *
20349  * free(tmpdata)
20350  * return 0 # <<<<<<<<<<<<<<
20351  *
20352  * @cname('__pyx_memoryview_broadcast_leading')
20353  */
20354  __pyx_r = 0;
20355  goto __pyx_L0;
20356 
20357  /* "View.MemoryView":1268
20358  *
20359  * @cname('__pyx_memoryview_copy_contents')
20360  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20361  * __Pyx_memviewslice dst,
20362  * int src_ndim, int dst_ndim,
20363  */
20364 
20365  /* function exit code */
20366  __pyx_L1_error:;
20367  {
20368  #ifdef WITH_THREAD
20369  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20370  #endif
20371  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20372  #ifdef WITH_THREAD
20373  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20374  #endif
20375  }
20376  __pyx_r = -1;
20377  __pyx_L0:;
20378  return __pyx_r;
20379 }
20380 
20381 /* "View.MemoryView":1340
20382  *
20383  * @cname('__pyx_memoryview_broadcast_leading')
20384  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20385  * int ndim,
20386  * int ndim_other) nogil:
20387  */
20388 
20389 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
20390  int __pyx_v_i;
20391  int __pyx_v_offset;
20392  int __pyx_t_1;
20393  int __pyx_t_2;
20394  int __pyx_t_3;
20395 
20396  /* "View.MemoryView":1344
20397  * int ndim_other) nogil:
20398  * cdef int i
20399  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
20400  *
20401  * for i in range(ndim - 1, -1, -1):
20402  */
20403  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20404 
20405  /* "View.MemoryView":1346
20406  * cdef int offset = ndim_other - ndim
20407  *
20408  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
20409  * mslice.shape[i + offset] = mslice.shape[i]
20410  * mslice.strides[i + offset] = mslice.strides[i]
20411  */
20412  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20413  __pyx_v_i = __pyx_t_1;
20414 
20415  /* "View.MemoryView":1347
20416  *
20417  * for i in range(ndim - 1, -1, -1):
20418  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
20419  * mslice.strides[i + offset] = mslice.strides[i]
20420  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20421  */
20422  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20423 
20424  /* "View.MemoryView":1348
20425  * for i in range(ndim - 1, -1, -1):
20426  * mslice.shape[i + offset] = mslice.shape[i]
20427  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
20428  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20429  *
20430  */
20431  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20432 
20433  /* "View.MemoryView":1349
20434  * mslice.shape[i + offset] = mslice.shape[i]
20435  * mslice.strides[i + offset] = mslice.strides[i]
20436  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
20437  *
20438  * for i in range(offset):
20439  */
20440  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20441  }
20442 
20443  /* "View.MemoryView":1351
20444  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20445  *
20446  * for i in range(offset): # <<<<<<<<<<<<<<
20447  * mslice.shape[i] = 1
20448  * mslice.strides[i] = mslice.strides[0]
20449  */
20450  __pyx_t_1 = __pyx_v_offset;
20451  __pyx_t_2 = __pyx_t_1;
20452  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20453  __pyx_v_i = __pyx_t_3;
20454 
20455  /* "View.MemoryView":1352
20456  *
20457  * for i in range(offset):
20458  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
20459  * mslice.strides[i] = mslice.strides[0]
20460  * mslice.suboffsets[i] = -1
20461  */
20462  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20463 
20464  /* "View.MemoryView":1353
20465  * for i in range(offset):
20466  * mslice.shape[i] = 1
20467  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
20468  * mslice.suboffsets[i] = -1
20469  *
20470  */
20471  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20472 
20473  /* "View.MemoryView":1354
20474  * mslice.shape[i] = 1
20475  * mslice.strides[i] = mslice.strides[0]
20476  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20477  *
20478  *
20479  */
20480  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
20481  }
20482 
20483  /* "View.MemoryView":1340
20484  *
20485  * @cname('__pyx_memoryview_broadcast_leading')
20486  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20487  * int ndim,
20488  * int ndim_other) nogil:
20489  */
20490 
20491  /* function exit code */
20492 }
20493 
20494 /* "View.MemoryView":1362
20495  *
20496  * @cname('__pyx_memoryview_refcount_copying')
20497  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20498  * int ndim, bint inc) nogil:
20499  *
20500  */
20501 
20502 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
20503  int __pyx_t_1;
20504 
20505  /* "View.MemoryView":1366
20506  *
20507  *
20508  * if dtype_is_object: # <<<<<<<<<<<<<<
20509  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20510  * dst.strides, ndim, inc)
20511  */
20512  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20513  if (__pyx_t_1) {
20514 
20515  /* "View.MemoryView":1367
20516  *
20517  * if dtype_is_object:
20518  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
20519  * dst.strides, ndim, inc)
20520  *
20521  */
20522  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20523 
20524  /* "View.MemoryView":1366
20525  *
20526  *
20527  * if dtype_is_object: # <<<<<<<<<<<<<<
20528  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20529  * dst.strides, ndim, inc)
20530  */
20531  }
20532 
20533  /* "View.MemoryView":1362
20534  *
20535  * @cname('__pyx_memoryview_refcount_copying')
20536  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20537  * int ndim, bint inc) nogil:
20538  *
20539  */
20540 
20541  /* function exit code */
20542 }
20543 
20544 /* "View.MemoryView":1371
20545  *
20546  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20547  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20548  * Py_ssize_t *strides, int ndim,
20549  * bint inc) with gil:
20550  */
20551 
20552 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20553  __Pyx_RefNannyDeclarations
20554  #ifdef WITH_THREAD
20555  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20556  #endif
20557  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
20558 
20559  /* "View.MemoryView":1374
20560  * Py_ssize_t *strides, int ndim,
20561  * bint inc) with gil:
20562  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
20563  *
20564  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20565  */
20566  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20567 
20568  /* "View.MemoryView":1371
20569  *
20570  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20571  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20572  * Py_ssize_t *strides, int ndim,
20573  * bint inc) with gil:
20574  */
20575 
20576  /* function exit code */
20577  __Pyx_RefNannyFinishContext();
20578  #ifdef WITH_THREAD
20579  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20580  #endif
20581 }
20582 
20583 /* "View.MemoryView":1377
20584  *
20585  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20586  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20587  * Py_ssize_t *strides, int ndim, bint inc):
20588  * cdef Py_ssize_t i
20589  */
20590 
20591 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20592  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20593  __Pyx_RefNannyDeclarations
20594  Py_ssize_t __pyx_t_1;
20595  Py_ssize_t __pyx_t_2;
20596  Py_ssize_t __pyx_t_3;
20597  int __pyx_t_4;
20598  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
20599 
20600  /* "View.MemoryView":1381
20601  * cdef Py_ssize_t i
20602  *
20603  * for i in range(shape[0]): # <<<<<<<<<<<<<<
20604  * if ndim == 1:
20605  * if inc:
20606  */
20607  __pyx_t_1 = (__pyx_v_shape[0]);
20608  __pyx_t_2 = __pyx_t_1;
20609  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20610  __pyx_v_i = __pyx_t_3;
20611 
20612  /* "View.MemoryView":1382
20613  *
20614  * for i in range(shape[0]):
20615  * if ndim == 1: # <<<<<<<<<<<<<<
20616  * if inc:
20617  * Py_INCREF((<PyObject **> data)[0])
20618  */
20619  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20620  if (__pyx_t_4) {
20621 
20622  /* "View.MemoryView":1383
20623  * for i in range(shape[0]):
20624  * if ndim == 1:
20625  * if inc: # <<<<<<<<<<<<<<
20626  * Py_INCREF((<PyObject **> data)[0])
20627  * else:
20628  */
20629  __pyx_t_4 = (__pyx_v_inc != 0);
20630  if (__pyx_t_4) {
20631 
20632  /* "View.MemoryView":1384
20633  * if ndim == 1:
20634  * if inc:
20635  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20636  * else:
20637  * Py_DECREF((<PyObject **> data)[0])
20638  */
20639  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20640 
20641  /* "View.MemoryView":1383
20642  * for i in range(shape[0]):
20643  * if ndim == 1:
20644  * if inc: # <<<<<<<<<<<<<<
20645  * Py_INCREF((<PyObject **> data)[0])
20646  * else:
20647  */
20648  goto __pyx_L6;
20649  }
20650 
20651  /* "View.MemoryView":1386
20652  * Py_INCREF((<PyObject **> data)[0])
20653  * else:
20654  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20655  * else:
20656  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20657  */
20658  /*else*/ {
20659  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20660  }
20661  __pyx_L6:;
20662 
20663  /* "View.MemoryView":1382
20664  *
20665  * for i in range(shape[0]):
20666  * if ndim == 1: # <<<<<<<<<<<<<<
20667  * if inc:
20668  * Py_INCREF((<PyObject **> data)[0])
20669  */
20670  goto __pyx_L5;
20671  }
20672 
20673  /* "View.MemoryView":1388
20674  * Py_DECREF((<PyObject **> data)[0])
20675  * else:
20676  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20677  * ndim - 1, inc)
20678  *
20679  */
20680  /*else*/ {
20681 
20682  /* "View.MemoryView":1389
20683  * else:
20684  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20685  * ndim - 1, inc) # <<<<<<<<<<<<<<
20686  *
20687  * data += strides[0]
20688  */
20689  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20690  }
20691  __pyx_L5:;
20692 
20693  /* "View.MemoryView":1391
20694  * ndim - 1, inc)
20695  *
20696  * data += strides[0] # <<<<<<<<<<<<<<
20697  *
20698  *
20699  */
20700  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20701  }
20702 
20703  /* "View.MemoryView":1377
20704  *
20705  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20706  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20707  * Py_ssize_t *strides, int ndim, bint inc):
20708  * cdef Py_ssize_t i
20709  */
20710 
20711  /* function exit code */
20712  __Pyx_RefNannyFinishContext();
20713 }
20714 
20715 /* "View.MemoryView":1397
20716  *
20717  * @cname('__pyx_memoryview_slice_assign_scalar')
20718  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20719  * size_t itemsize, void *item,
20720  * bint dtype_is_object) nogil:
20721  */
20722 
20723 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
20724 
20725  /* "View.MemoryView":1400
20726  * size_t itemsize, void *item,
20727  * bint dtype_is_object) nogil:
20728  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20729  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20730  * itemsize, item)
20731  */
20732  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20733 
20734  /* "View.MemoryView":1401
20735  * bint dtype_is_object) nogil:
20736  * refcount_copying(dst, dtype_is_object, ndim, False)
20737  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
20738  * itemsize, item)
20739  * refcount_copying(dst, dtype_is_object, ndim, True)
20740  */
20741  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20742 
20743  /* "View.MemoryView":1403
20744  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20745  * itemsize, item)
20746  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20747  *
20748  *
20749  */
20750  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20751 
20752  /* "View.MemoryView":1397
20753  *
20754  * @cname('__pyx_memoryview_slice_assign_scalar')
20755  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20756  * size_t itemsize, void *item,
20757  * bint dtype_is_object) nogil:
20758  */
20759 
20760  /* function exit code */
20761 }
20762 
20763 /* "View.MemoryView":1407
20764  *
20765  * @cname('__pyx_memoryview__slice_assign_scalar')
20766  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20767  * Py_ssize_t *strides, int ndim,
20768  * size_t itemsize, void *item) nogil:
20769  */
20770 
20771 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
20772  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20773  Py_ssize_t __pyx_v_stride;
20774  Py_ssize_t __pyx_v_extent;
20775  int __pyx_t_1;
20776  Py_ssize_t __pyx_t_2;
20777  Py_ssize_t __pyx_t_3;
20778  Py_ssize_t __pyx_t_4;
20779 
20780  /* "View.MemoryView":1411
20781  * size_t itemsize, void *item) nogil:
20782  * cdef Py_ssize_t i
20783  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
20784  * cdef Py_ssize_t extent = shape[0]
20785  *
20786  */
20787  __pyx_v_stride = (__pyx_v_strides[0]);
20788 
20789  /* "View.MemoryView":1412
20790  * cdef Py_ssize_t i
20791  * cdef Py_ssize_t stride = strides[0]
20792  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
20793  *
20794  * if ndim == 1:
20795  */
20796  __pyx_v_extent = (__pyx_v_shape[0]);
20797 
20798  /* "View.MemoryView":1414
20799  * cdef Py_ssize_t extent = shape[0]
20800  *
20801  * if ndim == 1: # <<<<<<<<<<<<<<
20802  * for i in range(extent):
20803  * memcpy(data, item, itemsize)
20804  */
20805  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20806  if (__pyx_t_1) {
20807 
20808  /* "View.MemoryView":1415
20809  *
20810  * if ndim == 1:
20811  * for i in range(extent): # <<<<<<<<<<<<<<
20812  * memcpy(data, item, itemsize)
20813  * data += stride
20814  */
20815  __pyx_t_2 = __pyx_v_extent;
20816  __pyx_t_3 = __pyx_t_2;
20817  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20818  __pyx_v_i = __pyx_t_4;
20819 
20820  /* "View.MemoryView":1416
20821  * if ndim == 1:
20822  * for i in range(extent):
20823  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
20824  * data += stride
20825  * else:
20826  */
20827  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20828 
20829  /* "View.MemoryView":1417
20830  * for i in range(extent):
20831  * memcpy(data, item, itemsize)
20832  * data += stride # <<<<<<<<<<<<<<
20833  * else:
20834  * for i in range(extent):
20835  */
20836  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20837  }
20838 
20839  /* "View.MemoryView":1414
20840  * cdef Py_ssize_t extent = shape[0]
20841  *
20842  * if ndim == 1: # <<<<<<<<<<<<<<
20843  * for i in range(extent):
20844  * memcpy(data, item, itemsize)
20845  */
20846  goto __pyx_L3;
20847  }
20848 
20849  /* "View.MemoryView":1419
20850  * data += stride
20851  * else:
20852  * for i in range(extent): # <<<<<<<<<<<<<<
20853  * _slice_assign_scalar(data, shape + 1, strides + 1,
20854  * ndim - 1, itemsize, item)
20855  */
20856  /*else*/ {
20857  __pyx_t_2 = __pyx_v_extent;
20858  __pyx_t_3 = __pyx_t_2;
20859  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20860  __pyx_v_i = __pyx_t_4;
20861 
20862  /* "View.MemoryView":1420
20863  * else:
20864  * for i in range(extent):
20865  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20866  * ndim - 1, itemsize, item)
20867  * data += stride
20868  */
20869  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20870 
20871  /* "View.MemoryView":1422
20872  * _slice_assign_scalar(data, shape + 1, strides + 1,
20873  * ndim - 1, itemsize, item)
20874  * data += stride # <<<<<<<<<<<<<<
20875  *
20876  *
20877  */
20878  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20879  }
20880  }
20881  __pyx_L3:;
20882 
20883  /* "View.MemoryView":1407
20884  *
20885  * @cname('__pyx_memoryview__slice_assign_scalar')
20886  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20887  * Py_ssize_t *strides, int ndim,
20888  * size_t itemsize, void *item) nogil:
20889  */
20890 
20891  /* function exit code */
20892 }
20893 
20894 /* "(tree fragment)":1
20895  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20896  * cdef object __pyx_PickleError
20897  * cdef object __pyx_result
20898  */
20899 
20900 /* Python wrapper */
20901 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20902 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20903 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20904  PyObject *__pyx_v___pyx_type = 0;
20905  long __pyx_v___pyx_checksum;
20906  PyObject *__pyx_v___pyx_state = 0;
20907  int __pyx_lineno = 0;
20908  const char *__pyx_filename = NULL;
20909  int __pyx_clineno = 0;
20910  PyObject *__pyx_r = 0;
20911  __Pyx_RefNannyDeclarations
20912  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
20913  {
20914  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20915  PyObject* values[3] = {0,0,0};
20916  if (unlikely(__pyx_kwds)) {
20917  Py_ssize_t kw_args;
20918  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20919  switch (pos_args) {
20920  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20921  CYTHON_FALLTHROUGH;
20922  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20923  CYTHON_FALLTHROUGH;
20924  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20925  CYTHON_FALLTHROUGH;
20926  case 0: break;
20927  default: goto __pyx_L5_argtuple_error;
20928  }
20929  kw_args = PyDict_Size(__pyx_kwds);
20930  switch (pos_args) {
20931  case 0:
20932  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20933  else goto __pyx_L5_argtuple_error;
20934  CYTHON_FALLTHROUGH;
20935  case 1:
20936  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20937  else {
20938  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
20939  }
20940  CYTHON_FALLTHROUGH;
20941  case 2:
20942  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20943  else {
20944  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
20945  }
20946  }
20947  if (unlikely(kw_args > 0)) {
20948  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
20949  }
20950  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20951  goto __pyx_L5_argtuple_error;
20952  } else {
20953  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20954  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20955  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20956  }
20957  __pyx_v___pyx_type = values[0];
20958  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
20959  __pyx_v___pyx_state = values[2];
20960  }
20961  goto __pyx_L4_argument_unpacking_done;
20962  __pyx_L5_argtuple_error:;
20963  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
20964  __pyx_L3_error:;
20965  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20966  __Pyx_RefNannyFinishContext();
20967  return NULL;
20968  __pyx_L4_argument_unpacking_done:;
20969  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20970 
20971  /* function exit code */
20972  __Pyx_RefNannyFinishContext();
20973  return __pyx_r;
20974 }
20975 
20976 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20977  PyObject *__pyx_v___pyx_PickleError = 0;
20978  PyObject *__pyx_v___pyx_result = 0;
20979  PyObject *__pyx_r = NULL;
20980  __Pyx_RefNannyDeclarations
20981  int __pyx_t_1;
20982  PyObject *__pyx_t_2 = NULL;
20983  PyObject *__pyx_t_3 = NULL;
20984  PyObject *__pyx_t_4 = NULL;
20985  PyObject *__pyx_t_5 = NULL;
20986  int __pyx_t_6;
20987  int __pyx_lineno = 0;
20988  const char *__pyx_filename = NULL;
20989  int __pyx_clineno = 0;
20990  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
20991 
20992  /* "(tree fragment)":4
20993  * cdef object __pyx_PickleError
20994  * cdef object __pyx_result
20995  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
20996  * from pickle import PickleError as __pyx_PickleError
20997  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20998  */
20999  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
21000  if (__pyx_t_1) {
21001 
21002  /* "(tree fragment)":5
21003  * cdef object __pyx_result
21004  * if __pyx_checksum != 0xb068931:
21005  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
21006  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21007  * __pyx_result = Enum.__new__(__pyx_type)
21008  */
21009  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
21010  __Pyx_GOTREF(__pyx_t_2);
21011  __Pyx_INCREF(__pyx_n_s_PickleError);
21012  __Pyx_GIVEREF(__pyx_n_s_PickleError);
21013  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
21014  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
21015  __Pyx_GOTREF(__pyx_t_3);
21016  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21017  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
21018  __Pyx_GOTREF(__pyx_t_2);
21019  __Pyx_INCREF(__pyx_t_2);
21020  __pyx_v___pyx_PickleError = __pyx_t_2;
21021  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21022  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21023 
21024  /* "(tree fragment)":6
21025  * if __pyx_checksum != 0xb068931:
21026  * from pickle import PickleError as __pyx_PickleError
21027  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
21028  * __pyx_result = Enum.__new__(__pyx_type)
21029  * if __pyx_state is not None:
21030  */
21031  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
21032  __Pyx_GOTREF(__pyx_t_2);
21033  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
21034  __Pyx_GOTREF(__pyx_t_4);
21035  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21036  __Pyx_INCREF(__pyx_v___pyx_PickleError);
21037  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
21038  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
21039  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
21040  if (likely(__pyx_t_5)) {
21041  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21042  __Pyx_INCREF(__pyx_t_5);
21043  __Pyx_INCREF(function);
21044  __Pyx_DECREF_SET(__pyx_t_2, function);
21045  }
21046  }
21047  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
21048  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21049  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21050  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
21051  __Pyx_GOTREF(__pyx_t_3);
21052  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21053  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21054  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21055  __PYX_ERR(2, 6, __pyx_L1_error)
21056 
21057  /* "(tree fragment)":4
21058  * cdef object __pyx_PickleError
21059  * cdef object __pyx_result
21060  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
21061  * from pickle import PickleError as __pyx_PickleError
21062  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21063  */
21064  }
21065 
21066  /* "(tree fragment)":7
21067  * from pickle import PickleError as __pyx_PickleError
21068  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21069  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
21070  * if __pyx_state is not None:
21071  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21072  */
21073  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
21074  __Pyx_GOTREF(__pyx_t_2);
21075  __pyx_t_4 = NULL;
21076  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
21077  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
21078  if (likely(__pyx_t_4)) {
21079  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21080  __Pyx_INCREF(__pyx_t_4);
21081  __Pyx_INCREF(function);
21082  __Pyx_DECREF_SET(__pyx_t_2, function);
21083  }
21084  }
21085  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
21086  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21087  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
21088  __Pyx_GOTREF(__pyx_t_3);
21089  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21090  __pyx_v___pyx_result = __pyx_t_3;
21091  __pyx_t_3 = 0;
21092 
21093  /* "(tree fragment)":8
21094  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21095  * __pyx_result = Enum.__new__(__pyx_type)
21096  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21097  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21098  * return __pyx_result
21099  */
21100  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
21101  __pyx_t_6 = (__pyx_t_1 != 0);
21102  if (__pyx_t_6) {
21103 
21104  /* "(tree fragment)":9
21105  * __pyx_result = Enum.__new__(__pyx_type)
21106  * if __pyx_state is not None:
21107  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
21108  * return __pyx_result
21109  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21110  */
21111  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
21112  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
21113  __Pyx_GOTREF(__pyx_t_3);
21114  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21115 
21116  /* "(tree fragment)":8
21117  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21118  * __pyx_result = Enum.__new__(__pyx_type)
21119  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21120  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21121  * return __pyx_result
21122  */
21123  }
21124 
21125  /* "(tree fragment)":10
21126  * if __pyx_state is not None:
21127  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21128  * return __pyx_result # <<<<<<<<<<<<<<
21129  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21130  * __pyx_result.name = __pyx_state[0]
21131  */
21132  __Pyx_XDECREF(__pyx_r);
21133  __Pyx_INCREF(__pyx_v___pyx_result);
21134  __pyx_r = __pyx_v___pyx_result;
21135  goto __pyx_L0;
21136 
21137  /* "(tree fragment)":1
21138  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21139  * cdef object __pyx_PickleError
21140  * cdef object __pyx_result
21141  */
21142 
21143  /* function exit code */
21144  __pyx_L1_error:;
21145  __Pyx_XDECREF(__pyx_t_2);
21146  __Pyx_XDECREF(__pyx_t_3);
21147  __Pyx_XDECREF(__pyx_t_4);
21148  __Pyx_XDECREF(__pyx_t_5);
21149  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21150  __pyx_r = NULL;
21151  __pyx_L0:;
21152  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21153  __Pyx_XDECREF(__pyx_v___pyx_result);
21154  __Pyx_XGIVEREF(__pyx_r);
21155  __Pyx_RefNannyFinishContext();
21156  return __pyx_r;
21157 }
21158 
21159 /* "(tree fragment)":11
21160  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21161  * return __pyx_result
21162  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21163  * __pyx_result.name = __pyx_state[0]
21164  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21165  */
21166 
21167 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21168  PyObject *__pyx_r = NULL;
21169  __Pyx_RefNannyDeclarations
21170  PyObject *__pyx_t_1 = NULL;
21171  int __pyx_t_2;
21172  Py_ssize_t __pyx_t_3;
21173  int __pyx_t_4;
21174  int __pyx_t_5;
21175  PyObject *__pyx_t_6 = NULL;
21176  PyObject *__pyx_t_7 = NULL;
21177  PyObject *__pyx_t_8 = NULL;
21178  int __pyx_lineno = 0;
21179  const char *__pyx_filename = NULL;
21180  int __pyx_clineno = 0;
21181  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
21182 
21183  /* "(tree fragment)":12
21184  * return __pyx_result
21185  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21186  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
21187  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21188  * __pyx_result.__dict__.update(__pyx_state[1])
21189  */
21190  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21191  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21192  __PYX_ERR(2, 12, __pyx_L1_error)
21193  }
21194  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
21195  __Pyx_GOTREF(__pyx_t_1);
21196  __Pyx_GIVEREF(__pyx_t_1);
21197  __Pyx_GOTREF(__pyx_v___pyx_result->name);
21198  __Pyx_DECREF(__pyx_v___pyx_result->name);
21199  __pyx_v___pyx_result->name = __pyx_t_1;
21200  __pyx_t_1 = 0;
21201 
21202  /* "(tree fragment)":13
21203  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21204  * __pyx_result.name = __pyx_state[0]
21205  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21206  * __pyx_result.__dict__.update(__pyx_state[1])
21207  */
21208  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21209  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
21210  __PYX_ERR(2, 13, __pyx_L1_error)
21211  }
21212  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
21213  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21214  if (__pyx_t_4) {
21215  } else {
21216  __pyx_t_2 = __pyx_t_4;
21217  goto __pyx_L4_bool_binop_done;
21218  }
21219  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
21220  __pyx_t_5 = (__pyx_t_4 != 0);
21221  __pyx_t_2 = __pyx_t_5;
21222  __pyx_L4_bool_binop_done:;
21223  if (__pyx_t_2) {
21224 
21225  /* "(tree fragment)":14
21226  * __pyx_result.name = __pyx_state[0]
21227  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21228  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
21229  */
21230  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
21231  __Pyx_GOTREF(__pyx_t_6);
21232  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
21233  __Pyx_GOTREF(__pyx_t_7);
21234  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21235  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21236  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21237  __PYX_ERR(2, 14, __pyx_L1_error)
21238  }
21239  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
21240  __Pyx_GOTREF(__pyx_t_6);
21241  __pyx_t_8 = NULL;
21242  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21243  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21244  if (likely(__pyx_t_8)) {
21245  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
21246  __Pyx_INCREF(__pyx_t_8);
21247  __Pyx_INCREF(function);
21248  __Pyx_DECREF_SET(__pyx_t_7, function);
21249  }
21250  }
21251  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
21252  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21253  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21254  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
21255  __Pyx_GOTREF(__pyx_t_1);
21256  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21257  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21258 
21259  /* "(tree fragment)":13
21260  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21261  * __pyx_result.name = __pyx_state[0]
21262  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21263  * __pyx_result.__dict__.update(__pyx_state[1])
21264  */
21265  }
21266 
21267  /* "(tree fragment)":11
21268  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21269  * return __pyx_result
21270  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21271  * __pyx_result.name = __pyx_state[0]
21272  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21273  */
21274 
21275  /* function exit code */
21276  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21277  goto __pyx_L0;
21278  __pyx_L1_error:;
21279  __Pyx_XDECREF(__pyx_t_1);
21280  __Pyx_XDECREF(__pyx_t_6);
21281  __Pyx_XDECREF(__pyx_t_7);
21282  __Pyx_XDECREF(__pyx_t_8);
21283  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21284  __pyx_r = 0;
21285  __pyx_L0:;
21286  __Pyx_XGIVEREF(__pyx_r);
21287  __Pyx_RefNannyFinishContext();
21288  return __pyx_r;
21289 }
21290 
21291 /* "BufferFormatFromTypeInfo":1463
21292  *
21293  * @cname('__pyx_format_from_typeinfo')
21294  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
21295  * cdef __Pyx_StructField *field
21296  * cdef __pyx_typeinfo_string fmt
21297  */
21298 
21299 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) {
21300  __Pyx_StructField *__pyx_v_field;
21301  struct __pyx_typeinfo_string __pyx_v_fmt;
21302  PyObject *__pyx_v_part = 0;
21303  PyObject *__pyx_v_result = 0;
21304  PyObject *__pyx_v_alignment = NULL;
21305  PyObject *__pyx_v_parts = NULL;
21306  PyObject *__pyx_v_extents = NULL;
21307  int __pyx_v_i;
21308  PyObject *__pyx_r = NULL;
21309  __Pyx_RefNannyDeclarations
21310  int __pyx_t_1;
21311  PyObject *__pyx_t_2 = NULL;
21312  __Pyx_StructField *__pyx_t_3;
21313  PyObject *__pyx_t_4 = NULL;
21314  PyObject *__pyx_t_5 = NULL;
21315  int __pyx_t_6;
21316  int __pyx_t_7;
21317  int __pyx_t_8;
21318  int __pyx_t_9;
21319  int __pyx_lineno = 0;
21320  const char *__pyx_filename = NULL;
21321  int __pyx_clineno = 0;
21322  __Pyx_RefNannySetupContext("format_from_typeinfo", 0);
21323 
21324  /* "BufferFormatFromTypeInfo":1468
21325  * cdef bytes part, result
21326  *
21327  * if type.typegroup == 'S': # <<<<<<<<<<<<<<
21328  * assert type.fields != NULL
21329  * assert type.fields.type != NULL
21330  */
21331  __pyx_t_1 = ((__pyx_v_type->typegroup == 'S') != 0);
21332  if (__pyx_t_1) {
21333 
21334  /* "BufferFormatFromTypeInfo":1469
21335  *
21336  * if type.typegroup == 'S':
21337  * assert type.fields != NULL # <<<<<<<<<<<<<<
21338  * assert type.fields.type != NULL
21339  *
21340  */
21341  #ifndef CYTHON_WITHOUT_ASSERTIONS
21342  if (unlikely(!Py_OptimizeFlag)) {
21343  if (unlikely(!((__pyx_v_type->fields != NULL) != 0))) {
21344  PyErr_SetNone(PyExc_AssertionError);
21345  __PYX_ERR(2, 1469, __pyx_L1_error)
21346  }
21347  }
21348  #endif
21349 
21350  /* "BufferFormatFromTypeInfo":1470
21351  * if type.typegroup == 'S':
21352  * assert type.fields != NULL
21353  * assert type.fields.type != NULL # <<<<<<<<<<<<<<
21354  *
21355  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
21356  */
21357  #ifndef CYTHON_WITHOUT_ASSERTIONS
21358  if (unlikely(!Py_OptimizeFlag)) {
21359  if (unlikely(!((__pyx_v_type->fields->type != NULL) != 0))) {
21360  PyErr_SetNone(PyExc_AssertionError);
21361  __PYX_ERR(2, 1470, __pyx_L1_error)
21362  }
21363  }
21364  #endif
21365 
21366  /* "BufferFormatFromTypeInfo":1472
21367  * assert type.fields.type != NULL
21368  *
21369  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
21370  * alignment = b'^'
21371  * else:
21372  */
21373  __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
21374  if (__pyx_t_1) {
21375 
21376  /* "BufferFormatFromTypeInfo":1473
21377  *
21378  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
21379  * alignment = b'^' # <<<<<<<<<<<<<<
21380  * else:
21381  * alignment = b''
21382  */
21383  __Pyx_INCREF(__pyx_kp_b__21);
21384  __pyx_v_alignment = __pyx_kp_b__21;
21385 
21386  /* "BufferFormatFromTypeInfo":1472
21387  * assert type.fields.type != NULL
21388  *
21389  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
21390  * alignment = b'^'
21391  * else:
21392  */
21393  goto __pyx_L4;
21394  }
21395 
21396  /* "BufferFormatFromTypeInfo":1475
21397  * alignment = b'^'
21398  * else:
21399  * alignment = b'' # <<<<<<<<<<<<<<
21400  *
21401  * parts = [b"T{"]
21402  */
21403  /*else*/ {
21404  __Pyx_INCREF(__pyx_kp_b__22);
21405  __pyx_v_alignment = __pyx_kp_b__22;
21406  }
21407  __pyx_L4:;
21408 
21409  /* "BufferFormatFromTypeInfo":1477
21410  * alignment = b''
21411  *
21412  * parts = [b"T{"] # <<<<<<<<<<<<<<
21413  * field = type.fields
21414  *
21415  */
21416  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1477, __pyx_L1_error)
21417  __Pyx_GOTREF(__pyx_t_2);
21418  __Pyx_INCREF(__pyx_kp_b_T);
21419  __Pyx_GIVEREF(__pyx_kp_b_T);
21420  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_b_T);
21421  __pyx_v_parts = ((PyObject*)__pyx_t_2);
21422  __pyx_t_2 = 0;
21423 
21424  /* "BufferFormatFromTypeInfo":1478
21425  *
21426  * parts = [b"T{"]
21427  * field = type.fields # <<<<<<<<<<<<<<
21428  *
21429  * while field.type:
21430  */
21431  __pyx_t_3 = __pyx_v_type->fields;
21432  __pyx_v_field = __pyx_t_3;
21433 
21434  /* "BufferFormatFromTypeInfo":1480
21435  * field = type.fields
21436  *
21437  * while field.type: # <<<<<<<<<<<<<<
21438  * part = format_from_typeinfo(field.type)
21439  * parts.append(part + b':' + field.name + b':')
21440  */
21441  while (1) {
21442  __pyx_t_1 = (__pyx_v_field->type != 0);
21443  if (!__pyx_t_1) break;
21444 
21445  /* "BufferFormatFromTypeInfo":1481
21446  *
21447  * while field.type:
21448  * part = format_from_typeinfo(field.type) # <<<<<<<<<<<<<<
21449  * parts.append(part + b':' + field.name + b':')
21450  * field += 1
21451  */
21452  __pyx_t_2 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1481, __pyx_L1_error)
21453  __Pyx_GOTREF(__pyx_t_2);
21454  __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
21455  __pyx_t_2 = 0;
21456 
21457  /* "BufferFormatFromTypeInfo":1482
21458  * while field.type:
21459  * part = format_from_typeinfo(field.type)
21460  * parts.append(part + b':' + field.name + b':') # <<<<<<<<<<<<<<
21461  * field += 1
21462  *
21463  */
21464  __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__23); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1482, __pyx_L1_error)
21465  __Pyx_GOTREF(__pyx_t_2);
21466  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1482, __pyx_L1_error)
21467  __Pyx_GOTREF(__pyx_t_4);
21468  __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1482, __pyx_L1_error)
21469  __Pyx_GOTREF(__pyx_t_5);
21470  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21471  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21472  __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__23); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1482, __pyx_L1_error)
21473  __Pyx_GOTREF(__pyx_t_4);
21474  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21475  __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1482, __pyx_L1_error)
21476  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21477 
21478  /* "BufferFormatFromTypeInfo":1483
21479  * part = format_from_typeinfo(field.type)
21480  * parts.append(part + b':' + field.name + b':')
21481  * field += 1 # <<<<<<<<<<<<<<
21482  *
21483  * result = alignment.join(parts) + b'}'
21484  */
21485  __pyx_v_field = (__pyx_v_field + 1);
21486  }
21487 
21488  /* "BufferFormatFromTypeInfo":1485
21489  * field += 1
21490  *
21491  * result = alignment.join(parts) + b'}' # <<<<<<<<<<<<<<
21492  * else:
21493  * fmt = __Pyx_TypeInfoToFormat(type)
21494  */
21495  __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1485, __pyx_L1_error)
21496  __Pyx_GOTREF(__pyx_t_4);
21497  __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_b__24); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1485, __pyx_L1_error)
21498  __Pyx_GOTREF(__pyx_t_5);
21499  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21500  if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(2, 1485, __pyx_L1_error)
21501  __pyx_v_result = ((PyObject*)__pyx_t_5);
21502  __pyx_t_5 = 0;
21503 
21504  /* "BufferFormatFromTypeInfo":1468
21505  * cdef bytes part, result
21506  *
21507  * if type.typegroup == 'S': # <<<<<<<<<<<<<<
21508  * assert type.fields != NULL
21509  * assert type.fields.type != NULL
21510  */
21511  goto __pyx_L3;
21512  }
21513 
21514  /* "BufferFormatFromTypeInfo":1487
21515  * result = alignment.join(parts) + b'}'
21516  * else:
21517  * fmt = __Pyx_TypeInfoToFormat(type) # <<<<<<<<<<<<<<
21518  * if type.arraysize[0]:
21519  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
21520  */
21521  /*else*/ {
21522  __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
21523 
21524  /* "BufferFormatFromTypeInfo":1488
21525  * else:
21526  * fmt = __Pyx_TypeInfoToFormat(type)
21527  * if type.arraysize[0]: # <<<<<<<<<<<<<<
21528  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
21529  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
21530  */
21531  __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
21532  if (__pyx_t_1) {
21533 
21534  /* "BufferFormatFromTypeInfo":1489
21535  * fmt = __Pyx_TypeInfoToFormat(type)
21536  * if type.arraysize[0]:
21537  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] # <<<<<<<<<<<<<<
21538  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
21539  * else:
21540  */
21541  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1489, __pyx_L1_error)
21542  __Pyx_GOTREF(__pyx_t_5);
21543  __pyx_t_7 = __pyx_v_type->ndim;
21544  __pyx_t_8 = __pyx_t_7;
21545  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
21546  __pyx_v_i = __pyx_t_9;
21547  __pyx_t_4 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1489, __pyx_L1_error)
21548  __Pyx_GOTREF(__pyx_t_4);
21549  __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1489, __pyx_L1_error)
21550  __Pyx_GOTREF(__pyx_t_2);
21551  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21552  if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 1489, __pyx_L1_error)
21553  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21554  }
21555  __pyx_v_extents = ((PyObject*)__pyx_t_5);
21556  __pyx_t_5 = 0;
21557 
21558  /* "BufferFormatFromTypeInfo":1490
21559  * if type.arraysize[0]:
21560  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
21561  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string # <<<<<<<<<<<<<<
21562  * else:
21563  * result = fmt.string
21564  */
21565  __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__25, __pyx_v_extents); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1490, __pyx_L1_error)
21566  __Pyx_GOTREF(__pyx_t_5);
21567  __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1490, __pyx_L1_error)
21568  __Pyx_GOTREF(__pyx_t_2);
21569  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21570  __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1490, __pyx_L1_error)
21571  __Pyx_GOTREF(__pyx_t_5);
21572  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21573  __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1490, __pyx_L1_error)
21574  __Pyx_GOTREF(__pyx_t_2);
21575  __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1490, __pyx_L1_error)
21576  __Pyx_GOTREF(__pyx_t_4);
21577  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21578  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21579  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 1490, __pyx_L1_error)
21580  __pyx_v_result = ((PyObject*)__pyx_t_4);
21581  __pyx_t_4 = 0;
21582 
21583  /* "BufferFormatFromTypeInfo":1488
21584  * else:
21585  * fmt = __Pyx_TypeInfoToFormat(type)
21586  * if type.arraysize[0]: # <<<<<<<<<<<<<<
21587  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
21588  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
21589  */
21590  goto __pyx_L7;
21591  }
21592 
21593  /* "BufferFormatFromTypeInfo":1492
21594  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
21595  * else:
21596  * result = fmt.string # <<<<<<<<<<<<<<
21597  *
21598  * return result
21599  */
21600  /*else*/ {
21601  __pyx_t_4 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1492, __pyx_L1_error)
21602  __Pyx_GOTREF(__pyx_t_4);
21603  __pyx_v_result = ((PyObject*)__pyx_t_4);
21604  __pyx_t_4 = 0;
21605  }
21606  __pyx_L7:;
21607  }
21608  __pyx_L3:;
21609 
21610  /* "BufferFormatFromTypeInfo":1494
21611  * result = fmt.string
21612  *
21613  * return result # <<<<<<<<<<<<<<
21614  */
21615  __Pyx_XDECREF(__pyx_r);
21616  __Pyx_INCREF(__pyx_v_result);
21617  __pyx_r = __pyx_v_result;
21618  goto __pyx_L0;
21619 
21620  /* "BufferFormatFromTypeInfo":1463
21621  *
21622  * @cname('__pyx_format_from_typeinfo')
21623  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
21624  * cdef __Pyx_StructField *field
21625  * cdef __pyx_typeinfo_string fmt
21626  */
21627 
21628  /* function exit code */
21629  __pyx_L1_error:;
21630  __Pyx_XDECREF(__pyx_t_2);
21631  __Pyx_XDECREF(__pyx_t_4);
21632  __Pyx_XDECREF(__pyx_t_5);
21633  __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
21634  __pyx_r = 0;
21635  __pyx_L0:;
21636  __Pyx_XDECREF(__pyx_v_part);
21637  __Pyx_XDECREF(__pyx_v_result);
21638  __Pyx_XDECREF(__pyx_v_alignment);
21639  __Pyx_XDECREF(__pyx_v_parts);
21640  __Pyx_XDECREF(__pyx_v_extents);
21641  __Pyx_XGIVEREF(__pyx_r);
21642  __Pyx_RefNannyFinishContext();
21643  return __pyx_r;
21644 }
21645 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21646 
21647 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21648  struct __pyx_array_obj *p;
21649  PyObject *o;
21650  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21651  o = (*t->tp_alloc)(t, 0);
21652  } else {
21653  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21654  }
21655  if (unlikely(!o)) return 0;
21656  p = ((struct __pyx_array_obj *)o);
21657  p->__pyx_vtab = __pyx_vtabptr_array;
21658  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21659  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21660  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
21661  return o;
21662  bad:
21663  Py_DECREF(o); o = 0;
21664  return NULL;
21665 }
21666 
21667 static void __pyx_tp_dealloc_array(PyObject *o) {
21668  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
21669  #if CYTHON_USE_TP_FINALIZE
21670  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21671  if (PyObject_CallFinalizerFromDealloc(o)) return;
21672  }
21673  #endif
21674  {
21675  PyObject *etype, *eval, *etb;
21676  PyErr_Fetch(&etype, &eval, &etb);
21677  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21678  __pyx_array___dealloc__(o);
21679  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21680  PyErr_Restore(etype, eval, etb);
21681  }
21682  Py_CLEAR(p->mode);
21683  Py_CLEAR(p->_format);
21684  (*Py_TYPE(o)->tp_free)(o);
21685 }
21686 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21687  PyObject *r;
21688  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21689  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21690  Py_DECREF(x);
21691  return r;
21692 }
21693 
21694 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21695  if (v) {
21696  return __pyx_array___setitem__(o, i, v);
21697  }
21698  else {
21699  PyErr_Format(PyExc_NotImplementedError,
21700  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21701  return -1;
21702  }
21703 }
21704 
21705 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
21706  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
21707  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21708  PyErr_Clear();
21709  v = __pyx_array___getattr__(o, n);
21710  }
21711  return v;
21712 }
21713 
21714 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
21715  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21716 }
21717 
21718 static PyMethodDef __pyx_methods_array[] = {
21719  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21720  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21721  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21722  {0, 0, 0, 0}
21723 };
21724 
21725 static struct PyGetSetDef __pyx_getsets_array[] = {
21726  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
21727  {0, 0, 0, 0, 0}
21728 };
21729 
21730 static PySequenceMethods __pyx_tp_as_sequence_array = {
21731  __pyx_array___len__, /*sq_length*/
21732  0, /*sq_concat*/
21733  0, /*sq_repeat*/
21734  __pyx_sq_item_array, /*sq_item*/
21735  0, /*sq_slice*/
21736  0, /*sq_ass_item*/
21737  0, /*sq_ass_slice*/
21738  0, /*sq_contains*/
21739  0, /*sq_inplace_concat*/
21740  0, /*sq_inplace_repeat*/
21741 };
21742 
21743 static PyMappingMethods __pyx_tp_as_mapping_array = {
21744  __pyx_array___len__, /*mp_length*/
21745  __pyx_array___getitem__, /*mp_subscript*/
21746  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
21747 };
21748 
21749 static PyBufferProcs __pyx_tp_as_buffer_array = {
21750  #if PY_MAJOR_VERSION < 3
21751  0, /*bf_getreadbuffer*/
21752  #endif
21753  #if PY_MAJOR_VERSION < 3
21754  0, /*bf_getwritebuffer*/
21755  #endif
21756  #if PY_MAJOR_VERSION < 3
21757  0, /*bf_getsegcount*/
21758  #endif
21759  #if PY_MAJOR_VERSION < 3
21760  0, /*bf_getcharbuffer*/
21761  #endif
21762  __pyx_array_getbuffer, /*bf_getbuffer*/
21763  0, /*bf_releasebuffer*/
21764 };
21765 
21766 static PyTypeObject __pyx_type___pyx_array = {
21767  PyVarObject_HEAD_INIT(0, 0)
21768  "cpartitioning.array", /*tp_name*/
21769  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
21770  0, /*tp_itemsize*/
21771  __pyx_tp_dealloc_array, /*tp_dealloc*/
21772  #if PY_VERSION_HEX < 0x030800b4
21773  0, /*tp_print*/
21774  #endif
21775  #if PY_VERSION_HEX >= 0x030800b4
21776  0, /*tp_vectorcall_offset*/
21777  #endif
21778  0, /*tp_getattr*/
21779  0, /*tp_setattr*/
21780  #if PY_MAJOR_VERSION < 3
21781  0, /*tp_compare*/
21782  #endif
21783  #if PY_MAJOR_VERSION >= 3
21784  0, /*tp_as_async*/
21785  #endif
21786  0, /*tp_repr*/
21787  0, /*tp_as_number*/
21788  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
21789  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
21790  0, /*tp_hash*/
21791  0, /*tp_call*/
21792  0, /*tp_str*/
21793  __pyx_tp_getattro_array, /*tp_getattro*/
21794  0, /*tp_setattro*/
21795  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
21796  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21797  0, /*tp_doc*/
21798  0, /*tp_traverse*/
21799  0, /*tp_clear*/
21800  0, /*tp_richcompare*/
21801  0, /*tp_weaklistoffset*/
21802  0, /*tp_iter*/
21803  0, /*tp_iternext*/
21804  __pyx_methods_array, /*tp_methods*/
21805  0, /*tp_members*/
21806  __pyx_getsets_array, /*tp_getset*/
21807  0, /*tp_base*/
21808  0, /*tp_dict*/
21809  0, /*tp_descr_get*/
21810  0, /*tp_descr_set*/
21811  0, /*tp_dictoffset*/
21812  0, /*tp_init*/
21813  0, /*tp_alloc*/
21814  __pyx_tp_new_array, /*tp_new*/
21815  0, /*tp_free*/
21816  0, /*tp_is_gc*/
21817  0, /*tp_bases*/
21818  0, /*tp_mro*/
21819  0, /*tp_cache*/
21820  0, /*tp_subclasses*/
21821  0, /*tp_weaklist*/
21822  0, /*tp_del*/
21823  0, /*tp_version_tag*/
21824  #if PY_VERSION_HEX >= 0x030400a1
21825  0, /*tp_finalize*/
21826  #endif
21827  #if PY_VERSION_HEX >= 0x030800b1
21828  0, /*tp_vectorcall*/
21829  #endif
21830  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21831  0, /*tp_print*/
21832  #endif
21833 };
21834 
21835 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21836  struct __pyx_MemviewEnum_obj *p;
21837  PyObject *o;
21838  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21839  o = (*t->tp_alloc)(t, 0);
21840  } else {
21841  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21842  }
21843  if (unlikely(!o)) return 0;
21844  p = ((struct __pyx_MemviewEnum_obj *)o);
21845  p->name = Py_None; Py_INCREF(Py_None);
21846  return o;
21847 }
21848 
21849 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21850  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21851  #if CYTHON_USE_TP_FINALIZE
21852  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21853  if (PyObject_CallFinalizerFromDealloc(o)) return;
21854  }
21855  #endif
21856  PyObject_GC_UnTrack(o);
21857  Py_CLEAR(p->name);
21858  (*Py_TYPE(o)->tp_free)(o);
21859 }
21860 
21861 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
21862  int e;
21863  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21864  if (p->name) {
21865  e = (*v)(p->name, a); if (e) return e;
21866  }
21867  return 0;
21868 }
21869 
21870 static int __pyx_tp_clear_Enum(PyObject *o) {
21871  PyObject* tmp;
21872  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21873  tmp = ((PyObject*)p->name);
21874  p->name = Py_None; Py_INCREF(Py_None);
21875  Py_XDECREF(tmp);
21876  return 0;
21877 }
21878 
21879 static PyMethodDef __pyx_methods_Enum[] = {
21880  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21881  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21882  {0, 0, 0, 0}
21883 };
21884 
21885 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21886  PyVarObject_HEAD_INIT(0, 0)
21887  "cpartitioning.Enum", /*tp_name*/
21888  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
21889  0, /*tp_itemsize*/
21890  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
21891  #if PY_VERSION_HEX < 0x030800b4
21892  0, /*tp_print*/
21893  #endif
21894  #if PY_VERSION_HEX >= 0x030800b4
21895  0, /*tp_vectorcall_offset*/
21896  #endif
21897  0, /*tp_getattr*/
21898  0, /*tp_setattr*/
21899  #if PY_MAJOR_VERSION < 3
21900  0, /*tp_compare*/
21901  #endif
21902  #if PY_MAJOR_VERSION >= 3
21903  0, /*tp_as_async*/
21904  #endif
21905  __pyx_MemviewEnum___repr__, /*tp_repr*/
21906  0, /*tp_as_number*/
21907  0, /*tp_as_sequence*/
21908  0, /*tp_as_mapping*/
21909  0, /*tp_hash*/
21910  0, /*tp_call*/
21911  0, /*tp_str*/
21912  0, /*tp_getattro*/
21913  0, /*tp_setattro*/
21914  0, /*tp_as_buffer*/
21915  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21916  0, /*tp_doc*/
21917  __pyx_tp_traverse_Enum, /*tp_traverse*/
21918  __pyx_tp_clear_Enum, /*tp_clear*/
21919  0, /*tp_richcompare*/
21920  0, /*tp_weaklistoffset*/
21921  0, /*tp_iter*/
21922  0, /*tp_iternext*/
21923  __pyx_methods_Enum, /*tp_methods*/
21924  0, /*tp_members*/
21925  0, /*tp_getset*/
21926  0, /*tp_base*/
21927  0, /*tp_dict*/
21928  0, /*tp_descr_get*/
21929  0, /*tp_descr_set*/
21930  0, /*tp_dictoffset*/
21931  __pyx_MemviewEnum___init__, /*tp_init*/
21932  0, /*tp_alloc*/
21933  __pyx_tp_new_Enum, /*tp_new*/
21934  0, /*tp_free*/
21935  0, /*tp_is_gc*/
21936  0, /*tp_bases*/
21937  0, /*tp_mro*/
21938  0, /*tp_cache*/
21939  0, /*tp_subclasses*/
21940  0, /*tp_weaklist*/
21941  0, /*tp_del*/
21942  0, /*tp_version_tag*/
21943  #if PY_VERSION_HEX >= 0x030400a1
21944  0, /*tp_finalize*/
21945  #endif
21946  #if PY_VERSION_HEX >= 0x030800b1
21947  0, /*tp_vectorcall*/
21948  #endif
21949  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21950  0, /*tp_print*/
21951  #endif
21952 };
21953 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
21954 
21955 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
21956  struct __pyx_memoryview_obj *p;
21957  PyObject *o;
21958  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21959  o = (*t->tp_alloc)(t, 0);
21960  } else {
21961  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21962  }
21963  if (unlikely(!o)) return 0;
21964  p = ((struct __pyx_memoryview_obj *)o);
21965  p->__pyx_vtab = __pyx_vtabptr_memoryview;
21966  p->obj = Py_None; Py_INCREF(Py_None);
21967  p->_size = Py_None; Py_INCREF(Py_None);
21968  p->_array_interface = Py_None; Py_INCREF(Py_None);
21969  p->view.obj = NULL;
21970  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
21971  return o;
21972  bad:
21973  Py_DECREF(o); o = 0;
21974  return NULL;
21975 }
21976 
21977 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
21978  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21979  #if CYTHON_USE_TP_FINALIZE
21980  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21981  if (PyObject_CallFinalizerFromDealloc(o)) return;
21982  }
21983  #endif
21984  PyObject_GC_UnTrack(o);
21985  {
21986  PyObject *etype, *eval, *etb;
21987  PyErr_Fetch(&etype, &eval, &etb);
21988  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21989  __pyx_memoryview___dealloc__(o);
21990  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21991  PyErr_Restore(etype, eval, etb);
21992  }
21993  Py_CLEAR(p->obj);
21994  Py_CLEAR(p->_size);
21995  Py_CLEAR(p->_array_interface);
21996  (*Py_TYPE(o)->tp_free)(o);
21997 }
21998 
21999 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
22000  int e;
22001  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22002  if (p->obj) {
22003  e = (*v)(p->obj, a); if (e) return e;
22004  }
22005  if (p->_size) {
22006  e = (*v)(p->_size, a); if (e) return e;
22007  }
22008  if (p->_array_interface) {
22009  e = (*v)(p->_array_interface, a); if (e) return e;
22010  }
22011  if (p->view.obj) {
22012  e = (*v)(p->view.obj, a); if (e) return e;
22013  }
22014  return 0;
22015 }
22016 
22017 static int __pyx_tp_clear_memoryview(PyObject *o) {
22018  PyObject* tmp;
22019  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22020  tmp = ((PyObject*)p->obj);
22021  p->obj = Py_None; Py_INCREF(Py_None);
22022  Py_XDECREF(tmp);
22023  tmp = ((PyObject*)p->_size);
22024  p->_size = Py_None; Py_INCREF(Py_None);
22025  Py_XDECREF(tmp);
22026  tmp = ((PyObject*)p->_array_interface);
22027  p->_array_interface = Py_None; Py_INCREF(Py_None);
22028  Py_XDECREF(tmp);
22029  Py_CLEAR(p->view.obj);
22030  return 0;
22031 }
22032 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22033  PyObject *r;
22034  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22035  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22036  Py_DECREF(x);
22037  return r;
22038 }
22039 
22040 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
22041  if (v) {
22042  return __pyx_memoryview___setitem__(o, i, v);
22043  }
22044  else {
22045  PyErr_Format(PyExc_NotImplementedError,
22046  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22047  return -1;
22048  }
22049 }
22050 
22051 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
22052  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22053 }
22054 
22055 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
22056  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22057 }
22058 
22059 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
22060  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22061 }
22062 
22063 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
22064  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22065 }
22066 
22067 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
22068  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22069 }
22070 
22071 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
22072  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22073 }
22074 
22075 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
22076  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22077 }
22078 
22079 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
22080  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22081 }
22082 
22083 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
22084  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22085 }
22086 
22087 static PyMethodDef __pyx_methods_memoryview[] = {
22088  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22089  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22090  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22091  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22092  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22093  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22094  {0, 0, 0, 0}
22095 };
22096 
22097 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22098  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
22099  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
22100  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
22101  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
22102  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
22103  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
22104  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
22105  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
22106  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
22107  {0, 0, 0, 0, 0}
22108 };
22109 
22110 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22111  __pyx_memoryview___len__, /*sq_length*/
22112  0, /*sq_concat*/
22113  0, /*sq_repeat*/
22114  __pyx_sq_item_memoryview, /*sq_item*/
22115  0, /*sq_slice*/
22116  0, /*sq_ass_item*/
22117  0, /*sq_ass_slice*/
22118  0, /*sq_contains*/
22119  0, /*sq_inplace_concat*/
22120  0, /*sq_inplace_repeat*/
22121 };
22122 
22123 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22124  __pyx_memoryview___len__, /*mp_length*/
22125  __pyx_memoryview___getitem__, /*mp_subscript*/
22126  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
22127 };
22128 
22129 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22130  #if PY_MAJOR_VERSION < 3
22131  0, /*bf_getreadbuffer*/
22132  #endif
22133  #if PY_MAJOR_VERSION < 3
22134  0, /*bf_getwritebuffer*/
22135  #endif
22136  #if PY_MAJOR_VERSION < 3
22137  0, /*bf_getsegcount*/
22138  #endif
22139  #if PY_MAJOR_VERSION < 3
22140  0, /*bf_getcharbuffer*/
22141  #endif
22142  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
22143  0, /*bf_releasebuffer*/
22144 };
22145 
22146 static PyTypeObject __pyx_type___pyx_memoryview = {
22147  PyVarObject_HEAD_INIT(0, 0)
22148  "cpartitioning.memoryview", /*tp_name*/
22149  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
22150  0, /*tp_itemsize*/
22151  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
22152  #if PY_VERSION_HEX < 0x030800b4
22153  0, /*tp_print*/
22154  #endif
22155  #if PY_VERSION_HEX >= 0x030800b4
22156  0, /*tp_vectorcall_offset*/
22157  #endif
22158  0, /*tp_getattr*/
22159  0, /*tp_setattr*/
22160  #if PY_MAJOR_VERSION < 3
22161  0, /*tp_compare*/
22162  #endif
22163  #if PY_MAJOR_VERSION >= 3
22164  0, /*tp_as_async*/
22165  #endif
22166  __pyx_memoryview___repr__, /*tp_repr*/
22167  0, /*tp_as_number*/
22168  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
22169  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
22170  0, /*tp_hash*/
22171  0, /*tp_call*/
22172  __pyx_memoryview___str__, /*tp_str*/
22173  0, /*tp_getattro*/
22174  0, /*tp_setattro*/
22175  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
22176  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22177  0, /*tp_doc*/
22178  __pyx_tp_traverse_memoryview, /*tp_traverse*/
22179  __pyx_tp_clear_memoryview, /*tp_clear*/
22180  0, /*tp_richcompare*/
22181  0, /*tp_weaklistoffset*/
22182  0, /*tp_iter*/
22183  0, /*tp_iternext*/
22184  __pyx_methods_memoryview, /*tp_methods*/
22185  0, /*tp_members*/
22186  __pyx_getsets_memoryview, /*tp_getset*/
22187  0, /*tp_base*/
22188  0, /*tp_dict*/
22189  0, /*tp_descr_get*/
22190  0, /*tp_descr_set*/
22191  0, /*tp_dictoffset*/
22192  0, /*tp_init*/
22193  0, /*tp_alloc*/
22194  __pyx_tp_new_memoryview, /*tp_new*/
22195  0, /*tp_free*/
22196  0, /*tp_is_gc*/
22197  0, /*tp_bases*/
22198  0, /*tp_mro*/
22199  0, /*tp_cache*/
22200  0, /*tp_subclasses*/
22201  0, /*tp_weaklist*/
22202  0, /*tp_del*/
22203  0, /*tp_version_tag*/
22204  #if PY_VERSION_HEX >= 0x030400a1
22205  0, /*tp_finalize*/
22206  #endif
22207  #if PY_VERSION_HEX >= 0x030800b1
22208  0, /*tp_vectorcall*/
22209  #endif
22210  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22211  0, /*tp_print*/
22212  #endif
22213 };
22214 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22215 
22216 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22217  struct __pyx_memoryviewslice_obj *p;
22218  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22219  if (unlikely(!o)) return 0;
22220  p = ((struct __pyx_memoryviewslice_obj *)o);
22221  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22222  p->from_object = Py_None; Py_INCREF(Py_None);
22223  p->from_slice.memview = NULL;
22224  return o;
22225 }
22226 
22227 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22228  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22229  #if CYTHON_USE_TP_FINALIZE
22230  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22231  if (PyObject_CallFinalizerFromDealloc(o)) return;
22232  }
22233  #endif
22234  PyObject_GC_UnTrack(o);
22235  {
22236  PyObject *etype, *eval, *etb;
22237  PyErr_Fetch(&etype, &eval, &etb);
22238  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22239  __pyx_memoryviewslice___dealloc__(o);
22240  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22241  PyErr_Restore(etype, eval, etb);
22242  }
22243  Py_CLEAR(p->from_object);
22244  PyObject_GC_Track(o);
22245  __pyx_tp_dealloc_memoryview(o);
22246 }
22247 
22248 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
22249  int e;
22250  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22251  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
22252  if (p->from_object) {
22253  e = (*v)(p->from_object, a); if (e) return e;
22254  }
22255  return 0;
22256 }
22257 
22258 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22259  PyObject* tmp;
22260  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22261  __pyx_tp_clear_memoryview(o);
22262  tmp = ((PyObject*)p->from_object);
22263  p->from_object = Py_None; Py_INCREF(Py_None);
22264  Py_XDECREF(tmp);
22265  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22266  return 0;
22267 }
22268 
22269 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
22270  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22271 }
22272 
22273 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22274  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22275  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22276  {0, 0, 0, 0}
22277 };
22278 
22279 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22280  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
22281  {0, 0, 0, 0, 0}
22282 };
22283 
22284 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22285  PyVarObject_HEAD_INIT(0, 0)
22286  "cpartitioning._memoryviewslice", /*tp_name*/
22287  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
22288  0, /*tp_itemsize*/
22289  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
22290  #if PY_VERSION_HEX < 0x030800b4
22291  0, /*tp_print*/
22292  #endif
22293  #if PY_VERSION_HEX >= 0x030800b4
22294  0, /*tp_vectorcall_offset*/
22295  #endif
22296  0, /*tp_getattr*/
22297  0, /*tp_setattr*/
22298  #if PY_MAJOR_VERSION < 3
22299  0, /*tp_compare*/
22300  #endif
22301  #if PY_MAJOR_VERSION >= 3
22302  0, /*tp_as_async*/
22303  #endif
22304  #if CYTHON_COMPILING_IN_PYPY
22305  __pyx_memoryview___repr__, /*tp_repr*/
22306  #else
22307  0, /*tp_repr*/
22308  #endif
22309  0, /*tp_as_number*/
22310  0, /*tp_as_sequence*/
22311  0, /*tp_as_mapping*/
22312  0, /*tp_hash*/
22313  0, /*tp_call*/
22314  #if CYTHON_COMPILING_IN_PYPY
22315  __pyx_memoryview___str__, /*tp_str*/
22316  #else
22317  0, /*tp_str*/
22318  #endif
22319  0, /*tp_getattro*/
22320  0, /*tp_setattro*/
22321  0, /*tp_as_buffer*/
22322  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22323  "Internal class for passing memoryview slices to Python", /*tp_doc*/
22324  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
22325  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
22326  0, /*tp_richcompare*/
22327  0, /*tp_weaklistoffset*/
22328  0, /*tp_iter*/
22329  0, /*tp_iternext*/
22330  __pyx_methods__memoryviewslice, /*tp_methods*/
22331  0, /*tp_members*/
22332  __pyx_getsets__memoryviewslice, /*tp_getset*/
22333  0, /*tp_base*/
22334  0, /*tp_dict*/
22335  0, /*tp_descr_get*/
22336  0, /*tp_descr_set*/
22337  0, /*tp_dictoffset*/
22338  0, /*tp_init*/
22339  0, /*tp_alloc*/
22340  __pyx_tp_new__memoryviewslice, /*tp_new*/
22341  0, /*tp_free*/
22342  0, /*tp_is_gc*/
22343  0, /*tp_bases*/
22344  0, /*tp_mro*/
22345  0, /*tp_cache*/
22346  0, /*tp_subclasses*/
22347  0, /*tp_weaklist*/
22348  0, /*tp_del*/
22349  0, /*tp_version_tag*/
22350  #if PY_VERSION_HEX >= 0x030400a1
22351  0, /*tp_finalize*/
22352  #endif
22353  #if PY_VERSION_HEX >= 0x030800b1
22354  0, /*tp_vectorcall*/
22355  #endif
22356  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22357  0, /*tp_print*/
22358  #endif
22359 };
22360 
22361 static PyMethodDef __pyx_methods[] = {
22362  {0, 0, 0, 0}
22363 };
22364 
22365 #if PY_MAJOR_VERSION >= 3
22366 #if CYTHON_PEP489_MULTI_PHASE_INIT
22367 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
22368 static int __pyx_pymod_exec_cpartitioning(PyObject* module); /*proto*/
22369 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22370  {Py_mod_create, (void*)__pyx_pymod_create},
22371  {Py_mod_exec, (void*)__pyx_pymod_exec_cpartitioning},
22372  {0, NULL}
22373 };
22374 #endif
22375 
22376 static struct PyModuleDef __pyx_moduledef = {
22377  PyModuleDef_HEAD_INIT,
22378  "cpartitioning",
22379  0, /* m_doc */
22380  #if CYTHON_PEP489_MULTI_PHASE_INIT
22381  0, /* m_size */
22382  #else
22383  -1, /* m_size */
22384  #endif
22385  __pyx_methods /* m_methods */,
22386  #if CYTHON_PEP489_MULTI_PHASE_INIT
22387  __pyx_moduledef_slots, /* m_slots */
22388  #else
22389  NULL, /* m_reload */
22390  #endif
22391  NULL, /* m_traverse */
22392  NULL, /* m_clear */
22393  NULL /* m_free */
22394 };
22395 #endif
22396 #ifndef CYTHON_SMALL_CODE
22397 #if defined(__clang__)
22398  #define CYTHON_SMALL_CODE
22399 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22400  #define CYTHON_SMALL_CODE __attribute__((cold))
22401 #else
22402  #define CYTHON_SMALL_CODE
22403 #endif
22404 #endif
22405 
22406 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22407  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22408  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22409  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22410  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22411  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22412  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22413  {&__pyx_n_s_Comm, __pyx_k_Comm, sizeof(__pyx_k_Comm), 0, 0, 1, 1},
22414  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22415  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22416  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22417  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
22418  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22419  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22420  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22421  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22422  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22423  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22424  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22425  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
22426  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22427  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22428  {&__pyx_kp_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 0},
22429  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22430  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22431  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22432  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22433  {&__pyx_kp_b__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 0, 0, 0},
22434  {&__pyx_kp_b__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 0, 0, 0},
22435  {&__pyx_kp_b__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 0, 0},
22436  {&__pyx_kp_b__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 0, 0},
22437  {&__pyx_kp_u__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 1, 0, 0},
22438  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22439  {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
22440  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
22441  {&__pyx_n_s_buildDiscontinuousGalerkinLocal2, __pyx_k_buildDiscontinuousGalerkinLocal2, sizeof(__pyx_k_buildDiscontinuousGalerkinLocal2), 0, 0, 1, 1},
22442  {&__pyx_n_s_buildQuadraticCubeLocal2GlobalMa, __pyx_k_buildQuadraticCubeLocal2GlobalMa, sizeof(__pyx_k_buildQuadraticCubeLocal2GlobalMa), 0, 0, 1, 1},
22443  {&__pyx_kp_s_buildQuadraticCubeSubdomain2Glob, __pyx_k_buildQuadraticCubeSubdomain2Glob, sizeof(__pyx_k_buildQuadraticCubeSubdomain2Glob), 0, 0, 1, 0},
22444  {&__pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2, __pyx_k_buildQuadraticCubeSubdomain2Glob_2, sizeof(__pyx_k_buildQuadraticCubeSubdomain2Glob_2), 0, 0, 1, 0},
22445  {&__pyx_n_s_buildQuadraticLocal2GlobalMappin, __pyx_k_buildQuadraticLocal2GlobalMappin, sizeof(__pyx_k_buildQuadraticLocal2GlobalMappin), 0, 0, 1, 1},
22446  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
22447  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
22448  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
22449  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22450  {&__pyx_n_s_cmesh, __pyx_k_cmesh, sizeof(__pyx_k_cmesh), 0, 0, 1, 1},
22451  {&__pyx_n_s_comm, __pyx_k_comm, sizeof(__pyx_k_comm), 0, 0, 1, 1},
22452  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22453  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22454  {&__pyx_n_s_convertPUMIPartitionToPython, __pyx_k_convertPUMIPartitionToPython, sizeof(__pyx_k_convertPUMIPartitionToPython), 0, 0, 1, 1},
22455  {&__pyx_n_s_cpartitioning, __pyx_k_cpartitioning, sizeof(__pyx_k_cpartitioning), 0, 0, 1, 1},
22456  {&__pyx_n_s_dgNumbering_subdomain2global, __pyx_k_dgNumbering_subdomain2global, sizeof(__pyx_k_dgNumbering_subdomain2global), 0, 0, 1, 1},
22457  {&__pyx_n_s_dg_dof_offsets_subdomain_owned, __pyx_k_dg_dof_offsets_subdomain_owned, sizeof(__pyx_k_dg_dof_offsets_subdomain_owned), 0, 0, 1, 1},
22458  {&__pyx_n_s_dg_subdomain_l2g, __pyx_k_dg_subdomain_l2g, sizeof(__pyx_k_dg_subdomain_l2g), 0, 0, 1, 1},
22459  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
22460  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22461  {&__pyx_n_s_edgeNumbering_subdomain2global, __pyx_k_edgeNumbering_subdomain2global, sizeof(__pyx_k_edgeNumbering_subdomain2global), 0, 0, 1, 1},
22462  {&__pyx_n_s_edgeOffsets_subdomain_owned, __pyx_k_edgeOffsets_subdomain_owned, sizeof(__pyx_k_edgeOffsets_subdomain_owned), 0, 0, 1, 1},
22463  {&__pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_k_elementBoundaryNumbering_subdoma, sizeof(__pyx_k_elementBoundaryNumbering_subdoma), 0, 0, 1, 1},
22464  {&__pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_k_elementBoundaryOffsets_subdomain, sizeof(__pyx_k_elementBoundaryOffsets_subdomain), 0, 0, 1, 1},
22465  {&__pyx_n_s_elementNumbering_subdomain2globa, __pyx_k_elementNumbering_subdomain2globa, sizeof(__pyx_k_elementNumbering_subdomain2globa), 0, 0, 1, 1},
22466  {&__pyx_n_s_elementOffsets_subdomain_owned, __pyx_k_elementOffsets_subdomain_owned, sizeof(__pyx_k_elementOffsets_subdomain_owned), 0, 0, 1, 1},
22467  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
22468  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22469  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
22470  {&__pyx_n_s_filebase, __pyx_k_filebase, sizeof(__pyx_k_filebase), 0, 0, 1, 1},
22471  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
22472  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
22473  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22474  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22475  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22476  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22477  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
22478  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
22479  {&__pyx_n_s_indexBase, __pyx_k_indexBase, sizeof(__pyx_k_indexBase), 0, 0, 1, 1},
22480  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22481  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22482  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
22483  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
22484  {&__pyx_n_s_max_dof_neighbors, __pyx_k_max_dof_neighbors, sizeof(__pyx_k_max_dof_neighbors), 0, 0, 1, 1},
22485  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
22486  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
22487  {&__pyx_n_s_nDOF_all_processes, __pyx_k_nDOF_all_processes, sizeof(__pyx_k_nDOF_all_processes), 0, 0, 1, 1},
22488  {&__pyx_n_s_nDOF_element, __pyx_k_nDOF_element, sizeof(__pyx_k_nDOF_element), 0, 0, 1, 1},
22489  {&__pyx_n_s_nDOF_subdomain, __pyx_k_nDOF_subdomain, sizeof(__pyx_k_nDOF_subdomain), 0, 0, 1, 1},
22490  {&__pyx_n_s_nLayersOfOverlap, __pyx_k_nLayersOfOverlap, sizeof(__pyx_k_nLayersOfOverlap), 0, 0, 1, 1},
22491  {&__pyx_n_s_nSpace, __pyx_k_nSpace, sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
22492  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
22493  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22494  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22495  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
22496  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22497  {&__pyx_n_s_nodeNumbering_subdomain2global, __pyx_k_nodeNumbering_subdomain2global, sizeof(__pyx_k_nodeNumbering_subdomain2global), 0, 0, 1, 1},
22498  {&__pyx_n_s_nodeOffsets_subdomain_owned, __pyx_k_nodeOffsets_subdomain_owned, sizeof(__pyx_k_nodeOffsets_subdomain_owned), 0, 0, 1, 1},
22499  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
22500  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22501  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
22502  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
22503  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
22504  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
22505  {&__pyx_n_s_partitionElements, __pyx_k_partitionElements, sizeof(__pyx_k_partitionElements), 0, 0, 1, 1},
22506  {&__pyx_n_s_partitionNodes, __pyx_k_partitionNodes, sizeof(__pyx_k_partitionNodes), 0, 0, 1, 1},
22507  {&__pyx_n_s_partitionNodesFromTetgenFiles, __pyx_k_partitionNodesFromTetgenFiles, sizeof(__pyx_k_partitionNodesFromTetgenFiles), 0, 0, 1, 1},
22508  {&__pyx_n_s_partitionNodesFromTriangleFiles, __pyx_k_partitionNodesFromTriangleFiles, sizeof(__pyx_k_partitionNodesFromTriangleFiles), 0, 0, 1, 1},
22509  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22510  {&__pyx_n_s_proteus, __pyx_k_proteus, sizeof(__pyx_k_proteus), 0, 0, 1, 1},
22511  {&__pyx_n_s_proteus_Comm, __pyx_k_proteus_Comm, sizeof(__pyx_k_proteus_Comm), 0, 0, 1, 1},
22512  {&__pyx_kp_s_proteus_cpartitioning_pyx, __pyx_k_proteus_cpartitioning_pyx, sizeof(__pyx_k_proteus_cpartitioning_pyx), 0, 0, 1, 0},
22513  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22514  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22515  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22516  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22517  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22518  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22519  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22520  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22521  {&__pyx_n_s_quadraticNumbering_subdomain2glo, __pyx_k_quadraticNumbering_subdomain2glo, sizeof(__pyx_k_quadraticNumbering_subdomain2glo), 0, 0, 1, 1},
22522  {&__pyx_n_s_quadratic_dof_offsets_subdomain, __pyx_k_quadratic_dof_offsets_subdomain, sizeof(__pyx_k_quadratic_dof_offsets_subdomain), 0, 0, 1, 1},
22523  {&__pyx_n_s_quadratic_lagrangeNodes, __pyx_k_quadratic_lagrangeNodes, sizeof(__pyx_k_quadratic_lagrangeNodes), 0, 0, 1, 1},
22524  {&__pyx_n_s_quadratic_subdomain_l2g, __pyx_k_quadratic_subdomain_l2g, sizeof(__pyx_k_quadratic_subdomain_l2g), 0, 0, 1, 1},
22525  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
22526  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22527  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22528  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22529  {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
22530  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22531  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22532  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
22533  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
22534  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
22535  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
22536  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
22537  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22538  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22539  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22540  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22541  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
22542  {&__pyx_n_s_subdomain_cmesh, __pyx_k_subdomain_cmesh, sizeof(__pyx_k_subdomain_cmesh), 0, 0, 1, 1},
22543  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
22544  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22545  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22546  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22547  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
22548  {0, 0, 0, 0, 0, 0, 0}
22549 };
22550 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
22551  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 945, __pyx_L1_error)
22552  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 133, __pyx_L1_error)
22553  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 148, __pyx_L1_error)
22554  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 151, __pyx_L1_error)
22555  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(2, 180, __pyx_L1_error)
22556  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error)
22557  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 404, __pyx_L1_error)
22558  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 613, __pyx_L1_error)
22559  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 832, __pyx_L1_error)
22560  return 0;
22561  __pyx_L1_error:;
22562  return -1;
22563 }
22564 
22565 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
22566  __Pyx_RefNannyDeclarations
22567  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
22568 
22569  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":945
22570  * __pyx_import_array()
22571  * except Exception:
22572  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
22573  *
22574  * cdef inline int import_umath() except -1:
22575  */
22576  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 945, __pyx_L1_error)
22577  __Pyx_GOTREF(__pyx_tuple_);
22578  __Pyx_GIVEREF(__pyx_tuple_);
22579 
22580  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":951
22581  * _import_umath()
22582  * except Exception:
22583  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
22584  *
22585  * cdef inline int import_ufunc() except -1:
22586  */
22587  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 951, __pyx_L1_error)
22588  __Pyx_GOTREF(__pyx_tuple__2);
22589  __Pyx_GIVEREF(__pyx_tuple__2);
22590 
22591  /* "View.MemoryView":133
22592  *
22593  * if not self.ndim:
22594  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
22595  *
22596  * if itemsize <= 0:
22597  */
22598  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 133, __pyx_L1_error)
22599  __Pyx_GOTREF(__pyx_tuple__3);
22600  __Pyx_GIVEREF(__pyx_tuple__3);
22601 
22602  /* "View.MemoryView":136
22603  *
22604  * if itemsize <= 0:
22605  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
22606  *
22607  * if not isinstance(format, bytes):
22608  */
22609  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 136, __pyx_L1_error)
22610  __Pyx_GOTREF(__pyx_tuple__4);
22611  __Pyx_GIVEREF(__pyx_tuple__4);
22612 
22613  /* "View.MemoryView":148
22614  *
22615  * if not self._shape:
22616  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
22617  *
22618  *
22619  */
22620  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 148, __pyx_L1_error)
22621  __Pyx_GOTREF(__pyx_tuple__5);
22622  __Pyx_GIVEREF(__pyx_tuple__5);
22623 
22624  /* "View.MemoryView":176
22625  * self.data = <char *>malloc(self.len)
22626  * if not self.data:
22627  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
22628  *
22629  * if self.dtype_is_object:
22630  */
22631  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 176, __pyx_L1_error)
22632  __Pyx_GOTREF(__pyx_tuple__6);
22633  __Pyx_GIVEREF(__pyx_tuple__6);
22634 
22635  /* "View.MemoryView":192
22636  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
22637  * if not (flags & bufmode):
22638  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
22639  * info.buf = self.data
22640  * info.len = self.len
22641  */
22642  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 192, __pyx_L1_error)
22643  __Pyx_GOTREF(__pyx_tuple__7);
22644  __Pyx_GIVEREF(__pyx_tuple__7);
22645 
22646  /* "(tree fragment)":2
22647  * def __reduce_cython__(self):
22648  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22649  * def __setstate_cython__(self, __pyx_state):
22650  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22651  */
22652  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 2, __pyx_L1_error)
22653  __Pyx_GOTREF(__pyx_tuple__8);
22654  __Pyx_GIVEREF(__pyx_tuple__8);
22655 
22656  /* "(tree fragment)":4
22657  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22658  * def __setstate_cython__(self, __pyx_state):
22659  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22660  */
22661  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 4, __pyx_L1_error)
22662  __Pyx_GOTREF(__pyx_tuple__9);
22663  __Pyx_GIVEREF(__pyx_tuple__9);
22664 
22665  /* "View.MemoryView":418
22666  * def __setitem__(memoryview self, object index, object value):
22667  * if self.view.readonly:
22668  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
22669  *
22670  * have_slices, index = _unellipsify(index, self.view.ndim)
22671  */
22672  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 418, __pyx_L1_error)
22673  __Pyx_GOTREF(__pyx_tuple__10);
22674  __Pyx_GIVEREF(__pyx_tuple__10);
22675 
22676  /* "View.MemoryView":495
22677  * result = struct.unpack(self.view.format, bytesitem)
22678  * except struct.error:
22679  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
22680  * else:
22681  * if len(self.view.format) == 1:
22682  */
22683  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 495, __pyx_L1_error)
22684  __Pyx_GOTREF(__pyx_tuple__11);
22685  __Pyx_GIVEREF(__pyx_tuple__11);
22686 
22687  /* "View.MemoryView":520
22688  * def __getbuffer__(self, Py_buffer *info, int flags):
22689  * if flags & PyBUF_WRITABLE and self.view.readonly:
22690  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
22691  *
22692  * if flags & PyBUF_ND:
22693  */
22694  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 520, __pyx_L1_error)
22695  __Pyx_GOTREF(__pyx_tuple__12);
22696  __Pyx_GIVEREF(__pyx_tuple__12);
22697 
22698  /* "View.MemoryView":570
22699  * if self.view.strides == NULL:
22700  *
22701  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
22702  *
22703  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
22704  */
22705  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 570, __pyx_L1_error)
22706  __Pyx_GOTREF(__pyx_tuple__13);
22707  __Pyx_GIVEREF(__pyx_tuple__13);
22708 
22709  /* "View.MemoryView":577
22710  * def suboffsets(self):
22711  * if self.view.suboffsets == NULL:
22712  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
22713  *
22714  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
22715  */
22716  __pyx_tuple__14 = PyTuple_New(1); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 577, __pyx_L1_error)
22717  __Pyx_GOTREF(__pyx_tuple__14);
22718  __Pyx_INCREF(__pyx_int_neg_1);
22719  __Pyx_GIVEREF(__pyx_int_neg_1);
22720  PyTuple_SET_ITEM(__pyx_tuple__14, 0, __pyx_int_neg_1);
22721  __Pyx_GIVEREF(__pyx_tuple__14);
22722 
22723  /* "(tree fragment)":2
22724  * def __reduce_cython__(self):
22725  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22726  * def __setstate_cython__(self, __pyx_state):
22727  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22728  */
22729  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 2, __pyx_L1_error)
22730  __Pyx_GOTREF(__pyx_tuple__15);
22731  __Pyx_GIVEREF(__pyx_tuple__15);
22732 
22733  /* "(tree fragment)":4
22734  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22735  * def __setstate_cython__(self, __pyx_state):
22736  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22737  */
22738  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 4, __pyx_L1_error)
22739  __Pyx_GOTREF(__pyx_tuple__16);
22740  __Pyx_GIVEREF(__pyx_tuple__16);
22741 
22742  /* "View.MemoryView":682
22743  * if item is Ellipsis:
22744  * if not seen_ellipsis:
22745  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
22746  * seen_ellipsis = True
22747  * else:
22748  */
22749  __pyx_slice__17 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__17)) __PYX_ERR(2, 682, __pyx_L1_error)
22750  __Pyx_GOTREF(__pyx_slice__17);
22751  __Pyx_GIVEREF(__pyx_slice__17);
22752 
22753  /* "View.MemoryView":703
22754  * for suboffset in suboffsets[:ndim]:
22755  * if suboffset >= 0:
22756  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
22757  *
22758  *
22759  */
22760  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 703, __pyx_L1_error)
22761  __Pyx_GOTREF(__pyx_tuple__18);
22762  __Pyx_GIVEREF(__pyx_tuple__18);
22763 
22764  /* "(tree fragment)":2
22765  * def __reduce_cython__(self):
22766  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22767  * def __setstate_cython__(self, __pyx_state):
22768  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22769  */
22770  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 2, __pyx_L1_error)
22771  __Pyx_GOTREF(__pyx_tuple__19);
22772  __Pyx_GIVEREF(__pyx_tuple__19);
22773 
22774  /* "(tree fragment)":4
22775  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22776  * def __setstate_cython__(self, __pyx_state):
22777  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22778  */
22779  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 4, __pyx_L1_error)
22780  __Pyx_GOTREF(__pyx_tuple__20);
22781  __Pyx_GIVEREF(__pyx_tuple__20);
22782 
22783  /* "cpartitioning.pyx":20
22784  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
22785  *
22786  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
22787  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
22788  * c_partitionElements(comm.ob_mpi,
22789  */
22790  __pyx_tuple__26 = PyTuple_Pack(4, __pyx_n_s_comm, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 20, __pyx_L1_error)
22791  __Pyx_GOTREF(__pyx_tuple__26);
22792  __Pyx_GIVEREF(__pyx_tuple__26);
22793  __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionElements, 20, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 20, __pyx_L1_error)
22794 
22795  /* "cpartitioning.pyx":36
22796  * )
22797  *
22798  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
22799  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
22800  * c_partitionNodes(comm.ob_mpi,
22801  */
22802  __pyx_tuple__28 = PyTuple_Pack(4, __pyx_n_s_comm, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 36, __pyx_L1_error)
22803  __Pyx_GOTREF(__pyx_tuple__28);
22804  __Pyx_GIVEREF(__pyx_tuple__28);
22805  __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionNodes, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 36, __pyx_L1_error)
22806 
22807  /* "cpartitioning.pyx":52
22808  * )
22809  *
22810  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
22811  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
22812  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
22813  */
22814  __pyx_tuple__30 = PyTuple_Pack(3, __pyx_n_s_comm, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 52, __pyx_L1_error)
22815  __Pyx_GOTREF(__pyx_tuple__30);
22816  __Pyx_GIVEREF(__pyx_tuple__30);
22817  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_convertPUMIPartitionToPython, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 52, __pyx_L1_error)
22818 
22819  /* "cpartitioning.pyx":66
22820  * )
22821  *
22822  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
22823  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
22824  * if not isinstance(filebase, bytes):
22825  */
22826  __pyx_tuple__32 = PyTuple_Pack(6, __pyx_n_s_comm, __pyx_n_s_filebase, __pyx_n_s_indexBase, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 66, __pyx_L1_error)
22827  __Pyx_GOTREF(__pyx_tuple__32);
22828  __Pyx_GIVEREF(__pyx_tuple__32);
22829  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionNodesFromTetgenFiles, 66, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 66, __pyx_L1_error)
22830 
22831  /* "cpartitioning.pyx":86
22832  * )
22833  *
22834  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
22835  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
22836  * if not isinstance(filebase, bytes):
22837  */
22838  __pyx_tuple__34 = PyTuple_Pack(6, __pyx_n_s_comm, __pyx_n_s_filebase, __pyx_n_s_indexBase, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 86, __pyx_L1_error)
22839  __Pyx_GOTREF(__pyx_tuple__34);
22840  __Pyx_GIVEREF(__pyx_tuple__34);
22841  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionNodesFromTriangleFiles, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 86, __pyx_L1_error)
22842 
22843  /* "cpartitioning.pyx":106
22844  * )
22845  *
22846  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
22847  * int nSpace,
22848  * cmeshTools.CMesh cmesh,
22849  */
22850  __pyx_tuple__36 = PyTuple_Pack(19, __pyx_n_s_comm, __pyx_n_s_nSpace, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh, __pyx_n_s_elementOffsets_subdomain_owned, __pyx_n_s_nodeOffsets_subdomain_owned, __pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_n_s_edgeOffsets_subdomain_owned, __pyx_n_s_elementNumbering_subdomain2globa, __pyx_n_s_nodeNumbering_subdomain2global, __pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_n_s_edgeNumbering_subdomain2global, __pyx_n_s_quadratic_dof_offsets_subdomain, __pyx_n_s_quadratic_subdomain_l2g, __pyx_n_s_quadraticNumbering_subdomain2glo, __pyx_n_s_quadratic_lagrangeNodes, __pyx_n_s_nDOF_all_processes, __pyx_n_s_nDOF_subdomain, __pyx_n_s_max_dof_neighbors); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 106, __pyx_L1_error)
22851  __Pyx_GOTREF(__pyx_tuple__36);
22852  __Pyx_GIVEREF(__pyx_tuple__36);
22853  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(16, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_buildQuadraticLocal2GlobalMappin, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 106, __pyx_L1_error)
22854 
22855  /* "cpartitioning.pyx":171
22856  * max_dof_neighbors)
22857  *
22858  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
22859  * int nSpace,
22860  * cmeshTools.CMesh cmesh,
22861  */
22862  __pyx_tuple__38 = PyTuple_Pack(19, __pyx_n_s_comm, __pyx_n_s_nSpace, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh, __pyx_n_s_elementOffsets_subdomain_owned, __pyx_n_s_nodeOffsets_subdomain_owned, __pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_n_s_edgeOffsets_subdomain_owned, __pyx_n_s_elementNumbering_subdomain2globa, __pyx_n_s_nodeNumbering_subdomain2global, __pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_n_s_edgeNumbering_subdomain2global, __pyx_n_s_quadratic_dof_offsets_subdomain, __pyx_n_s_quadratic_subdomain_l2g, __pyx_n_s_quadraticNumbering_subdomain2glo, __pyx_n_s_quadratic_lagrangeNodes, __pyx_n_s_nDOF_all_processes, __pyx_n_s_nDOF_subdomain, __pyx_n_s_max_dof_neighbors); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 171, __pyx_L1_error)
22863  __Pyx_GOTREF(__pyx_tuple__38);
22864  __Pyx_GIVEREF(__pyx_tuple__38);
22865  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(16, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_buildQuadraticCubeLocal2GlobalMa, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 171, __pyx_L1_error)
22866 
22867  /* "cpartitioning.pyx":212
22868  * max_dof_neighbors)
22869  *
22870  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
22871  * int nDOF_element,
22872  * cmeshTools.CMesh cmesh,
22873  */
22874  __pyx_tuple__40 = PyTuple_Pack(12, __pyx_n_s_comm, __pyx_n_s_nDOF_element, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh, __pyx_n_s_elementOffsets_subdomain_owned, __pyx_n_s_elementNumbering_subdomain2globa, __pyx_n_s_dg_dof_offsets_subdomain_owned, __pyx_n_s_dg_subdomain_l2g, __pyx_n_s_dgNumbering_subdomain2global, __pyx_n_s_nDOF_all_processes, __pyx_n_s_nDOF_subdomain, __pyx_n_s_max_dof_neighbors); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 212, __pyx_L1_error)
22875  __Pyx_GOTREF(__pyx_tuple__40);
22876  __Pyx_GIVEREF(__pyx_tuple__40);
22877  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_buildDiscontinuousGalerkinLocal2, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 212, __pyx_L1_error)
22878 
22879  /* "View.MemoryView":286
22880  * return self.name
22881  *
22882  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
22883  * cdef strided = Enum("<strided and direct>") # default
22884  * cdef indirect = Enum("<strided and indirect>")
22885  */
22886  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(2, 286, __pyx_L1_error)
22887  __Pyx_GOTREF(__pyx_tuple__42);
22888  __Pyx_GIVEREF(__pyx_tuple__42);
22889 
22890  /* "View.MemoryView":287
22891  *
22892  * cdef generic = Enum("<strided and direct or indirect>")
22893  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
22894  * cdef indirect = Enum("<strided and indirect>")
22895  *
22896  */
22897  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(2, 287, __pyx_L1_error)
22898  __Pyx_GOTREF(__pyx_tuple__43);
22899  __Pyx_GIVEREF(__pyx_tuple__43);
22900 
22901  /* "View.MemoryView":288
22902  * cdef generic = Enum("<strided and direct or indirect>")
22903  * cdef strided = Enum("<strided and direct>") # default
22904  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
22905  *
22906  *
22907  */
22908  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(2, 288, __pyx_L1_error)
22909  __Pyx_GOTREF(__pyx_tuple__44);
22910  __Pyx_GIVEREF(__pyx_tuple__44);
22911 
22912  /* "View.MemoryView":291
22913  *
22914  *
22915  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
22916  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
22917  *
22918  */
22919  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(2, 291, __pyx_L1_error)
22920  __Pyx_GOTREF(__pyx_tuple__45);
22921  __Pyx_GIVEREF(__pyx_tuple__45);
22922 
22923  /* "View.MemoryView":292
22924  *
22925  * cdef contiguous = Enum("<contiguous and direct>")
22926  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
22927  *
22928  *
22929  */
22930  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(2, 292, __pyx_L1_error)
22931  __Pyx_GOTREF(__pyx_tuple__46);
22932  __Pyx_GIVEREF(__pyx_tuple__46);
22933 
22934  /* "(tree fragment)":1
22935  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
22936  * cdef object __pyx_PickleError
22937  * cdef object __pyx_result
22938  */
22939  __pyx_tuple__47 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(2, 1, __pyx_L1_error)
22940  __Pyx_GOTREF(__pyx_tuple__47);
22941  __Pyx_GIVEREF(__pyx_tuple__47);
22942  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(2, 1, __pyx_L1_error)
22943  __Pyx_RefNannyFinishContext();
22944  return 0;
22945  __pyx_L1_error:;
22946  __Pyx_RefNannyFinishContext();
22947  return -1;
22948 }
22949 
22950 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
22951  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
22952  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22953  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22954  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
22955  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22956  return 0;
22957  __pyx_L1_error:;
22958  return -1;
22959 }
22960 
22961 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
22962 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
22963 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
22964 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
22965 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
22966 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
22967 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
22968 
22969 static int __Pyx_modinit_global_init_code(void) {
22970  __Pyx_RefNannyDeclarations
22971  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
22972  /*--- Global init code ---*/
22973  generic = Py_None; Py_INCREF(Py_None);
22974  strided = Py_None; Py_INCREF(Py_None);
22975  indirect = Py_None; Py_INCREF(Py_None);
22976  contiguous = Py_None; Py_INCREF(Py_None);
22977  indirect_contiguous = Py_None; Py_INCREF(Py_None);
22978  __Pyx_RefNannyFinishContext();
22979  return 0;
22980 }
22981 
22982 static int __Pyx_modinit_variable_export_code(void) {
22983  __Pyx_RefNannyDeclarations
22984  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
22985  /*--- Variable export code ---*/
22986  __Pyx_RefNannyFinishContext();
22987  return 0;
22988 }
22989 
22990 static int __Pyx_modinit_function_export_code(void) {
22991  __Pyx_RefNannyDeclarations
22992  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
22993  /*--- Function export code ---*/
22994  __Pyx_RefNannyFinishContext();
22995  return 0;
22996 }
22997 
22998 static int __Pyx_modinit_type_init_code(void) {
22999  __Pyx_RefNannyDeclarations
23000  int __pyx_lineno = 0;
23001  const char *__pyx_filename = NULL;
23002  int __pyx_clineno = 0;
23003  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
23004  /*--- Type init code ---*/
23005  __pyx_vtabptr_array = &__pyx_vtable_array;
23006  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
23007  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
23008  #if PY_VERSION_HEX < 0x030800B1
23009  __pyx_type___pyx_array.tp_print = 0;
23010  #endif
23011  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
23012  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
23013  __pyx_array_type = &__pyx_type___pyx_array;
23014  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
23015  #if PY_VERSION_HEX < 0x030800B1
23016  __pyx_type___pyx_MemviewEnum.tp_print = 0;
23017  #endif
23018  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23019  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23020  }
23021  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
23022  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23023  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23024  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23025  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23026  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23027  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23028  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23029  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
23030  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23031  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
23032  #if PY_VERSION_HEX < 0x030800B1
23033  __pyx_type___pyx_memoryview.tp_print = 0;
23034  #endif
23035  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23036  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23037  }
23038  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
23039  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
23040  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23041  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23042  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23043  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
23044  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23045  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23046  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
23047  #if PY_VERSION_HEX < 0x030800B1
23048  __pyx_type___pyx_memoryviewslice.tp_print = 0;
23049  #endif
23050  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23051  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23052  }
23053  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
23054  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
23055  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23056  __Pyx_RefNannyFinishContext();
23057  return 0;
23058  __pyx_L1_error:;
23059  __Pyx_RefNannyFinishContext();
23060  return -1;
23061 }
23062 
23063 static int __Pyx_modinit_type_import_code(void) {
23064  __Pyx_RefNannyDeclarations
23065  PyObject *__pyx_t_1 = NULL;
23066  int __pyx_lineno = 0;
23067  const char *__pyx_filename = NULL;
23068  int __pyx_clineno = 0;
23069  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
23070  /*--- Type import code ---*/
23071  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
23072  __Pyx_GOTREF(__pyx_t_1);
23073  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
23074  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23075  sizeof(PyTypeObject),
23076  #else
23077  sizeof(PyHeapTypeObject),
23078  #endif
23079  __Pyx_ImportType_CheckSize_Warn);
23080  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
23081  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23082  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
23083  __Pyx_GOTREF(__pyx_t_1);
23084  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
23085  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 200, __pyx_L1_error)
23086  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
23087  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 223, __pyx_L1_error)
23088  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
23089  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 227, __pyx_L1_error)
23090  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
23091  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 239, __pyx_L1_error)
23092  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23093  if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 771, __pyx_L1_error)
23094  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23095  if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 773, __pyx_L1_error)
23096  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23097  if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 775, __pyx_L1_error)
23098  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23099  if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 777, __pyx_L1_error)
23100  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23101  if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 779, __pyx_L1_error)
23102  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23103  if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 781, __pyx_L1_error)
23104  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23105  if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 783, __pyx_L1_error)
23106  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23107  if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 785, __pyx_L1_error)
23108  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23109  if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 787, __pyx_L1_error)
23110  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23111  if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 789, __pyx_L1_error)
23112  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
23113  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 827, __pyx_L1_error)
23114  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23115  __pyx_t_1 = PyImport_ImportModule("mpi4py.MPI"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 28, __pyx_L1_error)
23116  __Pyx_GOTREF(__pyx_t_1);
23117  __pyx_ptype_6mpi4py_3MPI_Status = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Status", sizeof(struct PyMPIStatusObject), __Pyx_ImportType_CheckSize_Warn);
23118  if (!__pyx_ptype_6mpi4py_3MPI_Status) __PYX_ERR(4, 28, __pyx_L1_error)
23119  __pyx_ptype_6mpi4py_3MPI_Datatype = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Datatype", sizeof(struct PyMPIDatatypeObject), __Pyx_ImportType_CheckSize_Warn);
23120  if (!__pyx_ptype_6mpi4py_3MPI_Datatype) __PYX_ERR(4, 35, __pyx_L1_error)
23121  __pyx_ptype_6mpi4py_3MPI_Request = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Request", sizeof(struct PyMPIRequestObject), __Pyx_ImportType_CheckSize_Warn);
23122  if (!__pyx_ptype_6mpi4py_3MPI_Request) __PYX_ERR(4, 42, __pyx_L1_error)
23123  __pyx_ptype_6mpi4py_3MPI_Prequest = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Prequest", sizeof(struct PyMPIPrequestObject), __Pyx_ImportType_CheckSize_Warn);
23124  if (!__pyx_ptype_6mpi4py_3MPI_Prequest) __PYX_ERR(4, 50, __pyx_L1_error)
23125  __pyx_ptype_6mpi4py_3MPI_Grequest = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Grequest", sizeof(struct PyMPIGrequestObject), __Pyx_ImportType_CheckSize_Warn);
23126  if (!__pyx_ptype_6mpi4py_3MPI_Grequest) __PYX_ERR(4, 56, __pyx_L1_error)
23127  __pyx_ptype_6mpi4py_3MPI_Message = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Message", sizeof(struct PyMPIMessageObject), __Pyx_ImportType_CheckSize_Warn);
23128  if (!__pyx_ptype_6mpi4py_3MPI_Message) __PYX_ERR(4, 62, __pyx_L1_error)
23129  __pyx_ptype_6mpi4py_3MPI_Op = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Op", sizeof(struct PyMPIOpObject), __Pyx_ImportType_CheckSize_Warn);
23130  if (!__pyx_ptype_6mpi4py_3MPI_Op) __PYX_ERR(4, 70, __pyx_L1_error)
23131  __pyx_ptype_6mpi4py_3MPI_Group = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Group", sizeof(struct PyMPIGroupObject), __Pyx_ImportType_CheckSize_Warn);
23132  if (!__pyx_ptype_6mpi4py_3MPI_Group) __PYX_ERR(4, 79, __pyx_L1_error)
23133  __pyx_ptype_6mpi4py_3MPI_Info = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Info", sizeof(struct PyMPIInfoObject), __Pyx_ImportType_CheckSize_Warn);
23134  if (!__pyx_ptype_6mpi4py_3MPI_Info) __PYX_ERR(4, 86, __pyx_L1_error)
23135  __pyx_ptype_6mpi4py_3MPI_Errhandler = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Errhandler", sizeof(struct PyMPIErrhandlerObject), __Pyx_ImportType_CheckSize_Warn);
23136  if (!__pyx_ptype_6mpi4py_3MPI_Errhandler) __PYX_ERR(4, 93, __pyx_L1_error)
23137  __pyx_ptype_6mpi4py_3MPI_Comm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Comm", sizeof(struct PyMPICommObject), __Pyx_ImportType_CheckSize_Warn);
23138  if (!__pyx_ptype_6mpi4py_3MPI_Comm) __PYX_ERR(4, 100, __pyx_L1_error)
23139  __pyx_ptype_6mpi4py_3MPI_Intracomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Intracomm", sizeof(struct PyMPIIntracommObject), __Pyx_ImportType_CheckSize_Warn);
23140  if (!__pyx_ptype_6mpi4py_3MPI_Intracomm) __PYX_ERR(4, 107, __pyx_L1_error)
23141  __pyx_ptype_6mpi4py_3MPI_Topocomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Topocomm", sizeof(struct PyMPITopocommObject), __Pyx_ImportType_CheckSize_Warn);
23142  if (!__pyx_ptype_6mpi4py_3MPI_Topocomm) __PYX_ERR(4, 113, __pyx_L1_error)
23143  __pyx_ptype_6mpi4py_3MPI_Cartcomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Cartcomm", sizeof(struct PyMPICartcommObject), __Pyx_ImportType_CheckSize_Warn);
23144  if (!__pyx_ptype_6mpi4py_3MPI_Cartcomm) __PYX_ERR(4, 119, __pyx_L1_error)
23145  __pyx_ptype_6mpi4py_3MPI_Graphcomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Graphcomm", sizeof(struct PyMPIGraphcommObject), __Pyx_ImportType_CheckSize_Warn);
23146  if (!__pyx_ptype_6mpi4py_3MPI_Graphcomm) __PYX_ERR(4, 125, __pyx_L1_error)
23147  __pyx_ptype_6mpi4py_3MPI_Distgraphcomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Distgraphcomm", sizeof(struct PyMPIDistgraphcommObject), __Pyx_ImportType_CheckSize_Warn);
23148  if (!__pyx_ptype_6mpi4py_3MPI_Distgraphcomm) __PYX_ERR(4, 131, __pyx_L1_error)
23149  __pyx_ptype_6mpi4py_3MPI_Intercomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Intercomm", sizeof(struct PyMPIIntercommObject), __Pyx_ImportType_CheckSize_Warn);
23150  if (!__pyx_ptype_6mpi4py_3MPI_Intercomm) __PYX_ERR(4, 137, __pyx_L1_error)
23151  __pyx_ptype_6mpi4py_3MPI_Win = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Win", sizeof(struct PyMPIWinObject), __Pyx_ImportType_CheckSize_Warn);
23152  if (!__pyx_ptype_6mpi4py_3MPI_Win) __PYX_ERR(4, 143, __pyx_L1_error)
23153  __pyx_ptype_6mpi4py_3MPI_File = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "File", sizeof(struct PyMPIFileObject), __Pyx_ImportType_CheckSize_Warn);
23154  if (!__pyx_ptype_6mpi4py_3MPI_File) __PYX_ERR(4, 151, __pyx_L1_error)
23155  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23156  __pyx_t_1 = PyImport_ImportModule("proteus.cmeshTools"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5, __pyx_L1_error)
23157  __Pyx_GOTREF(__pyx_t_1);
23158  __pyx_ptype_7proteus_10cmeshTools_CMesh = __Pyx_ImportType(__pyx_t_1, "proteus.cmeshTools", "CMesh", sizeof(struct __pyx_obj_7proteus_10cmeshTools_CMesh), __Pyx_ImportType_CheckSize_Warn);
23159  if (!__pyx_ptype_7proteus_10cmeshTools_CMesh) __PYX_ERR(5, 5, __pyx_L1_error)
23160  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23161  __Pyx_RefNannyFinishContext();
23162  return 0;
23163  __pyx_L1_error:;
23164  __Pyx_XDECREF(__pyx_t_1);
23165  __Pyx_RefNannyFinishContext();
23166  return -1;
23167 }
23168 
23169 static int __Pyx_modinit_variable_import_code(void) {
23170  __Pyx_RefNannyDeclarations
23171  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
23172  /*--- Variable import code ---*/
23173  __Pyx_RefNannyFinishContext();
23174  return 0;
23175 }
23176 
23177 static int __Pyx_modinit_function_import_code(void) {
23178  __Pyx_RefNannyDeclarations
23179  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
23180  /*--- Function import code ---*/
23181  __Pyx_RefNannyFinishContext();
23182  return 0;
23183 }
23184 
23185 
23186 #ifndef CYTHON_NO_PYINIT_EXPORT
23187 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23188 #elif PY_MAJOR_VERSION < 3
23189 #ifdef __cplusplus
23190 #define __Pyx_PyMODINIT_FUNC extern "C" void
23191 #else
23192 #define __Pyx_PyMODINIT_FUNC void
23193 #endif
23194 #else
23195 #ifdef __cplusplus
23196 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
23197 #else
23198 #define __Pyx_PyMODINIT_FUNC PyObject *
23199 #endif
23200 #endif
23201 
23202 
23203 #if PY_MAJOR_VERSION < 3
23204 __Pyx_PyMODINIT_FUNC initcpartitioning(void) CYTHON_SMALL_CODE; /*proto*/
23205 __Pyx_PyMODINIT_FUNC initcpartitioning(void)
23206 #else
23207 __Pyx_PyMODINIT_FUNC PyInit_cpartitioning(void) CYTHON_SMALL_CODE; /*proto*/
23208 __Pyx_PyMODINIT_FUNC PyInit_cpartitioning(void)
23209 #if CYTHON_PEP489_MULTI_PHASE_INIT
23210 {
23211  return PyModuleDef_Init(&__pyx_moduledef);
23212 }
23213 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
23214  #if PY_VERSION_HEX >= 0x030700A1
23215  static PY_INT64_T main_interpreter_id = -1;
23216  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
23217  if (main_interpreter_id == -1) {
23218  main_interpreter_id = current_id;
23219  return (unlikely(current_id == -1)) ? -1 : 0;
23220  } else if (unlikely(main_interpreter_id != current_id))
23221  #else
23222  static PyInterpreterState *main_interpreter = NULL;
23223  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
23224  if (!main_interpreter) {
23225  main_interpreter = current_interpreter;
23226  } else if (unlikely(main_interpreter != current_interpreter))
23227  #endif
23228  {
23229  PyErr_SetString(
23230  PyExc_ImportError,
23231  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
23232  return -1;
23233  }
23234  return 0;
23235 }
23236 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
23237  PyObject *value = PyObject_GetAttrString(spec, from_name);
23238  int result = 0;
23239  if (likely(value)) {
23240  if (allow_none || value != Py_None) {
23241  result = PyDict_SetItemString(moddict, to_name, value);
23242  }
23243  Py_DECREF(value);
23244  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23245  PyErr_Clear();
23246  } else {
23247  result = -1;
23248  }
23249  return result;
23250 }
23251 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23252  PyObject *module = NULL, *moddict, *modname;
23253  if (__Pyx_check_single_interpreter())
23254  return NULL;
23255  if (__pyx_m)
23256  return __Pyx_NewRef(__pyx_m);
23257  modname = PyObject_GetAttrString(spec, "name");
23258  if (unlikely(!modname)) goto bad;
23259  module = PyModule_NewObject(modname);
23260  Py_DECREF(modname);
23261  if (unlikely(!module)) goto bad;
23262  moddict = PyModule_GetDict(module);
23263  if (unlikely(!moddict)) goto bad;
23264  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
23265  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
23266  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
23267  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
23268  return module;
23269 bad:
23270  Py_XDECREF(module);
23271  return NULL;
23272 }
23273 
23274 
23275 static CYTHON_SMALL_CODE int __pyx_pymod_exec_cpartitioning(PyObject *__pyx_pyinit_module)
23276 #endif
23277 #endif
23278 {
23279  PyObject *__pyx_t_1 = NULL;
23280  PyObject *__pyx_t_2 = NULL;
23281  static PyThread_type_lock __pyx_t_3[8];
23282  int __pyx_lineno = 0;
23283  const char *__pyx_filename = NULL;
23284  int __pyx_clineno = 0;
23285  __Pyx_RefNannyDeclarations
23286  #if CYTHON_PEP489_MULTI_PHASE_INIT
23287  if (__pyx_m) {
23288  if (__pyx_m == __pyx_pyinit_module) return 0;
23289  PyErr_SetString(PyExc_RuntimeError, "Module 'cpartitioning' has already been imported. Re-initialisation is not supported.");
23290  return -1;
23291  }
23292  #elif PY_MAJOR_VERSION >= 3
23293  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
23294  #endif
23295  #if CYTHON_REFNANNY
23296 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
23297 if (!__Pyx_RefNanny) {
23298  PyErr_Clear();
23299  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
23300  if (!__Pyx_RefNanny)
23301  Py_FatalError("failed to import 'refnanny' module");
23302 }
23303 #endif
23304  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_cpartitioning(void)", 0);
23305  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23306  #ifdef __Pxy_PyFrame_Initialize_Offsets
23307  __Pxy_PyFrame_Initialize_Offsets();
23308  #endif
23309  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23310  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23311  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23312  #ifdef __Pyx_CyFunction_USED
23313  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23314  #endif
23315  #ifdef __Pyx_FusedFunction_USED
23316  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23317  #endif
23318  #ifdef __Pyx_Coroutine_USED
23319  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23320  #endif
23321  #ifdef __Pyx_Generator_USED
23322  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23323  #endif
23324  #ifdef __Pyx_AsyncGen_USED
23325  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23326  #endif
23327  #ifdef __Pyx_StopAsyncIteration_USED
23328  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23329  #endif
23330  /*--- Library function declarations ---*/
23331  /*--- Threads initialization code ---*/
23332  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23333  PyEval_InitThreads();
23334  #endif
23335  /*--- Module creation code ---*/
23336  #if CYTHON_PEP489_MULTI_PHASE_INIT
23337  __pyx_m = __pyx_pyinit_module;
23338  Py_INCREF(__pyx_m);
23339  #else
23340  #if PY_MAJOR_VERSION < 3
23341  __pyx_m = Py_InitModule4("cpartitioning", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23342  #else
23343  __pyx_m = PyModule_Create(&__pyx_moduledef);
23344  #endif
23345  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23346  #endif
23347  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23348  Py_INCREF(__pyx_d);
23349  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23350  Py_INCREF(__pyx_b);
23351  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23352  Py_INCREF(__pyx_cython_runtime);
23353  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23354  /*--- Initialize various global constants etc. ---*/
23355  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23356  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23357  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23358  #endif
23359  if (__pyx_module_is_main_cpartitioning) {
23360  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23361  }
23362  #if PY_MAJOR_VERSION >= 3
23363  {
23364  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23365  if (!PyDict_GetItemString(modules, "cpartitioning")) {
23366  if (unlikely(PyDict_SetItemString(modules, "cpartitioning", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23367  }
23368  }
23369  #endif
23370  /*--- Builtin init code ---*/
23371  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23372  /*--- Constants init code ---*/
23373  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23374  /*--- Global type/function init code ---*/
23375  (void)__Pyx_modinit_global_init_code();
23376  (void)__Pyx_modinit_variable_export_code();
23377  (void)__Pyx_modinit_function_export_code();
23378  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23379  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23380  (void)__Pyx_modinit_variable_import_code();
23381  (void)__Pyx_modinit_function_import_code();
23382  /*--- Execution code ---*/
23383  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23384  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23385  #endif
23386 
23387  /* "cpartitioning.pyx":2
23388  * # A type of -*- python -*- file
23389  * from proteus import Comm as proteus_Comm # <<<<<<<<<<<<<<
23390  * import numpy as np
23391  * cimport numpy as np
23392  */
23393  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
23394  __Pyx_GOTREF(__pyx_t_1);
23395  __Pyx_INCREF(__pyx_n_s_Comm);
23396  __Pyx_GIVEREF(__pyx_n_s_Comm);
23397  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Comm);
23398  __pyx_t_2 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error)
23399  __Pyx_GOTREF(__pyx_t_2);
23400  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23401  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Comm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
23402  __Pyx_GOTREF(__pyx_t_1);
23403  if (PyDict_SetItem(__pyx_d, __pyx_n_s_proteus_Comm, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
23404  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23405  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23406 
23407  /* "cpartitioning.pyx":3
23408  * # A type of -*- python -*- file
23409  * from proteus import Comm as proteus_Comm
23410  * import numpy as np # <<<<<<<<<<<<<<
23411  * cimport numpy as np
23412  * from mpi4py.MPI cimport (Comm,
23413  */
23414  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
23415  __Pyx_GOTREF(__pyx_t_2);
23416  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
23417  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23418 
23419  /* "cpartitioning.pyx":20
23420  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
23421  *
23422  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23423  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23424  * c_partitionElements(comm.ob_mpi,
23425  */
23426  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_1partitionElements, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
23427  __Pyx_GOTREF(__pyx_t_2);
23428  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionElements, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23429  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23430 
23431  /* "cpartitioning.pyx":36
23432  * )
23433  *
23434  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23435  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23436  * c_partitionNodes(comm.ob_mpi,
23437  */
23438  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_3partitionNodes, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
23439  __Pyx_GOTREF(__pyx_t_2);
23440  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionNodes, __pyx_t_2) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
23441  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23442 
23443  /* "cpartitioning.pyx":52
23444  * )
23445  *
23446  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23447  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
23448  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23449  */
23450  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_5convertPUMIPartitionToPython, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
23451  __Pyx_GOTREF(__pyx_t_2);
23452  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convertPUMIPartitionToPython, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
23453  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23454 
23455  /* "cpartitioning.pyx":66
23456  * )
23457  *
23458  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23459  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23460  * if not isinstance(filebase, bytes):
23461  */
23462  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_7partitionNodesFromTetgenFiles, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error)
23463  __Pyx_GOTREF(__pyx_t_2);
23464  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionNodesFromTetgenFiles, __pyx_t_2) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
23465  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23466 
23467  /* "cpartitioning.pyx":86
23468  * )
23469  *
23470  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23471  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23472  * if not isinstance(filebase, bytes):
23473  */
23474  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_9partitionNodesFromTriangleFiles, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
23475  __Pyx_GOTREF(__pyx_t_2);
23476  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionNodesFromTriangleFiles, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
23477  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23478 
23479  /* "cpartitioning.pyx":106
23480  * )
23481  *
23482  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23483  * int nSpace,
23484  * cmeshTools.CMesh cmesh,
23485  */
23486  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_11buildQuadraticLocal2GlobalMappings, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
23487  __Pyx_GOTREF(__pyx_t_2);
23488  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buildQuadraticLocal2GlobalMappin, __pyx_t_2) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
23489  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23490 
23491  /* "cpartitioning.pyx":171
23492  * max_dof_neighbors)
23493  *
23494  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23495  * int nSpace,
23496  * cmeshTools.CMesh cmesh,
23497  */
23498  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
23499  __Pyx_GOTREF(__pyx_t_2);
23500  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buildQuadraticCubeLocal2GlobalMa, __pyx_t_2) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
23501  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23502 
23503  /* "cpartitioning.pyx":212
23504  * max_dof_neighbors)
23505  *
23506  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23507  * int nDOF_element,
23508  * cmeshTools.CMesh cmesh,
23509  */
23510  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error)
23511  __Pyx_GOTREF(__pyx_t_2);
23512  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buildDiscontinuousGalerkinLocal2, __pyx_t_2) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
23513  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23514 
23515  /* "cpartitioning.pyx":1
23516  * # A type of -*- python -*- file # <<<<<<<<<<<<<<
23517  * from proteus import Comm as proteus_Comm
23518  * import numpy as np
23519  */
23520  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
23521  __Pyx_GOTREF(__pyx_t_2);
23522  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23523  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23524 
23525  /* "View.MemoryView":209
23526  * info.obj = self
23527  *
23528  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23529  *
23530  * def __dealloc__(array self):
23531  */
23532  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 209, __pyx_L1_error)
23533  __Pyx_GOTREF(__pyx_t_2);
23534  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 209, __pyx_L1_error)
23535  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23536  PyType_Modified(__pyx_array_type);
23537 
23538  /* "View.MemoryView":286
23539  * return self.name
23540  *
23541  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23542  * cdef strided = Enum("<strided and direct>") # default
23543  * cdef indirect = Enum("<strided and indirect>")
23544  */
23545  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 286, __pyx_L1_error)
23546  __Pyx_GOTREF(__pyx_t_2);
23547  __Pyx_XGOTREF(generic);
23548  __Pyx_DECREF_SET(generic, __pyx_t_2);
23549  __Pyx_GIVEREF(__pyx_t_2);
23550  __pyx_t_2 = 0;
23551 
23552  /* "View.MemoryView":287
23553  *
23554  * cdef generic = Enum("<strided and direct or indirect>")
23555  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23556  * cdef indirect = Enum("<strided and indirect>")
23557  *
23558  */
23559  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 287, __pyx_L1_error)
23560  __Pyx_GOTREF(__pyx_t_2);
23561  __Pyx_XGOTREF(strided);
23562  __Pyx_DECREF_SET(strided, __pyx_t_2);
23563  __Pyx_GIVEREF(__pyx_t_2);
23564  __pyx_t_2 = 0;
23565 
23566  /* "View.MemoryView":288
23567  * cdef generic = Enum("<strided and direct or indirect>")
23568  * cdef strided = Enum("<strided and direct>") # default
23569  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23570  *
23571  *
23572  */
23573  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 288, __pyx_L1_error)
23574  __Pyx_GOTREF(__pyx_t_2);
23575  __Pyx_XGOTREF(indirect);
23576  __Pyx_DECREF_SET(indirect, __pyx_t_2);
23577  __Pyx_GIVEREF(__pyx_t_2);
23578  __pyx_t_2 = 0;
23579 
23580  /* "View.MemoryView":291
23581  *
23582  *
23583  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23584  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23585  *
23586  */
23587  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 291, __pyx_L1_error)
23588  __Pyx_GOTREF(__pyx_t_2);
23589  __Pyx_XGOTREF(contiguous);
23590  __Pyx_DECREF_SET(contiguous, __pyx_t_2);
23591  __Pyx_GIVEREF(__pyx_t_2);
23592  __pyx_t_2 = 0;
23593 
23594  /* "View.MemoryView":292
23595  *
23596  * cdef contiguous = Enum("<contiguous and direct>")
23597  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23598  *
23599  *
23600  */
23601  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 292, __pyx_L1_error)
23602  __Pyx_GOTREF(__pyx_t_2);
23603  __Pyx_XGOTREF(indirect_contiguous);
23604  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
23605  __Pyx_GIVEREF(__pyx_t_2);
23606  __pyx_t_2 = 0;
23607 
23608  /* "View.MemoryView":316
23609  *
23610  * DEF THREAD_LOCKS_PREALLOCATED = 8
23611  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
23612  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
23613  * PyThread_allocate_lock(),
23614  */
23615  __pyx_memoryview_thread_locks_used = 0;
23616 
23617  /* "View.MemoryView":317
23618  * DEF THREAD_LOCKS_PREALLOCATED = 8
23619  * cdef int __pyx_memoryview_thread_locks_used = 0
23620  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
23621  * PyThread_allocate_lock(),
23622  * PyThread_allocate_lock(),
23623  */
23624  __pyx_t_3[0] = PyThread_allocate_lock();
23625  __pyx_t_3[1] = PyThread_allocate_lock();
23626  __pyx_t_3[2] = PyThread_allocate_lock();
23627  __pyx_t_3[3] = PyThread_allocate_lock();
23628  __pyx_t_3[4] = PyThread_allocate_lock();
23629  __pyx_t_3[5] = PyThread_allocate_lock();
23630  __pyx_t_3[6] = PyThread_allocate_lock();
23631  __pyx_t_3[7] = PyThread_allocate_lock();
23632  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23633 
23634  /* "View.MemoryView":549
23635  * info.obj = self
23636  *
23637  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23638  *
23639  *
23640  */
23641  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 549, __pyx_L1_error)
23642  __Pyx_GOTREF(__pyx_t_2);
23643  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 549, __pyx_L1_error)
23644  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23645  PyType_Modified(__pyx_memoryview_type);
23646 
23647  /* "View.MemoryView":995
23648  * return self.from_object
23649  *
23650  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23651  *
23652  *
23653  */
23654  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 995, __pyx_L1_error)
23655  __Pyx_GOTREF(__pyx_t_2);
23656  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 995, __pyx_L1_error)
23657  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23658  PyType_Modified(__pyx_memoryviewslice_type);
23659 
23660  /* "(tree fragment)":1
23661  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23662  * cdef object __pyx_PickleError
23663  * cdef object __pyx_result
23664  */
23665  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error)
23666  __Pyx_GOTREF(__pyx_t_2);
23667  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
23668  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23669 
23670  /* "BufferFormatFromTypeInfo":1463
23671  *
23672  * @cname('__pyx_format_from_typeinfo')
23673  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
23674  * cdef __Pyx_StructField *field
23675  * cdef __pyx_typeinfo_string fmt
23676  */
23677 
23678  /*--- Wrapped vars code ---*/
23679 
23680  goto __pyx_L0;
23681  __pyx_L1_error:;
23682  __Pyx_XDECREF(__pyx_t_1);
23683  __Pyx_XDECREF(__pyx_t_2);
23684  if (__pyx_m) {
23685  if (__pyx_d) {
23686  __Pyx_AddTraceback("init cpartitioning", __pyx_clineno, __pyx_lineno, __pyx_filename);
23687  }
23688  Py_CLEAR(__pyx_m);
23689  } else if (!PyErr_Occurred()) {
23690  PyErr_SetString(PyExc_ImportError, "init cpartitioning");
23691  }
23692  __pyx_L0:;
23693  __Pyx_RefNannyFinishContext();
23694  #if CYTHON_PEP489_MULTI_PHASE_INIT
23695  return (__pyx_m != NULL) ? 0 : -1;
23696  #elif PY_MAJOR_VERSION >= 3
23697  return __pyx_m;
23698  #else
23699  return;
23700  #endif
23701 }
23702 
23703 /* --- Runtime support code --- */
23704 /* Refnanny */
23705 #if CYTHON_REFNANNY
23706 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
23707  PyObject *m = NULL, *p = NULL;
23708  void *r = NULL;
23709  m = PyImport_ImportModule(modname);
23710  if (!m) goto end;
23711  p = PyObject_GetAttrString(m, "RefNannyAPI");
23712  if (!p) goto end;
23713  r = PyLong_AsVoidPtr(p);
23714 end:
23715  Py_XDECREF(p);
23716  Py_XDECREF(m);
23717  return (__Pyx_RefNannyAPIStruct *)r;
23718 }
23719 #endif
23720 
23721 /* RaiseArgTupleInvalid */
23722 static void __Pyx_RaiseArgtupleInvalid(
23723  const char* func_name,
23724  int exact,
23725  Py_ssize_t num_min,
23726  Py_ssize_t num_max,
23727  Py_ssize_t num_found)
23728 {
23729  Py_ssize_t num_expected;
23730  const char *more_or_less;
23731  if (num_found < num_min) {
23732  num_expected = num_min;
23733  more_or_less = "at least";
23734  } else {
23735  num_expected = num_max;
23736  more_or_less = "at most";
23737  }
23738  if (exact) {
23739  more_or_less = "exactly";
23740  }
23741  PyErr_Format(PyExc_TypeError,
23742  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
23743  func_name, more_or_less, num_expected,
23744  (num_expected == 1) ? "" : "s", num_found);
23745 }
23746 
23747 /* RaiseDoubleKeywords */
23748 static void __Pyx_RaiseDoubleKeywordsError(
23749  const char* func_name,
23750  PyObject* kw_name)
23751 {
23752  PyErr_Format(PyExc_TypeError,
23753  #if PY_MAJOR_VERSION >= 3
23754  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23755  #else
23756  "%s() got multiple values for keyword argument '%s'", func_name,
23757  PyString_AsString(kw_name));
23758  #endif
23759 }
23760 
23761 /* ParseKeywords */
23762 static int __Pyx_ParseOptionalKeywords(
23763  PyObject *kwds,
23764  PyObject **argnames[],
23765  PyObject *kwds2,
23766  PyObject *values[],
23767  Py_ssize_t num_pos_args,
23768  const char* function_name)
23769 {
23770  PyObject *key = 0, *value = 0;
23771  Py_ssize_t pos = 0;
23772  PyObject*** name;
23773  PyObject*** first_kw_arg = argnames + num_pos_args;
23774  while (PyDict_Next(kwds, &pos, &key, &value)) {
23775  name = first_kw_arg;
23776  while (*name && (**name != key)) name++;
23777  if (*name) {
23778  values[name-argnames] = value;
23779  continue;
23780  }
23781  name = first_kw_arg;
23782  #if PY_MAJOR_VERSION < 3
23783  if (likely(PyString_Check(key))) {
23784  while (*name) {
23785  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23786  && _PyString_Eq(**name, key)) {
23787  values[name-argnames] = value;
23788  break;
23789  }
23790  name++;
23791  }
23792  if (*name) continue;
23793  else {
23794  PyObject*** argname = argnames;
23795  while (argname != first_kw_arg) {
23796  if ((**argname == key) || (
23797  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23798  && _PyString_Eq(**argname, key))) {
23799  goto arg_passed_twice;
23800  }
23801  argname++;
23802  }
23803  }
23804  } else
23805  #endif
23806  if (likely(PyUnicode_Check(key))) {
23807  while (*name) {
23808  int cmp = (**name == key) ? 0 :
23809  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23810  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23811  #endif
23812  PyUnicode_Compare(**name, key);
23813  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23814  if (cmp == 0) {
23815  values[name-argnames] = value;
23816  break;
23817  }
23818  name++;
23819  }
23820  if (*name) continue;
23821  else {
23822  PyObject*** argname = argnames;
23823  while (argname != first_kw_arg) {
23824  int cmp = (**argname == key) ? 0 :
23825  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23826  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23827  #endif
23828  PyUnicode_Compare(**argname, key);
23829  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23830  if (cmp == 0) goto arg_passed_twice;
23831  argname++;
23832  }
23833  }
23834  } else
23835  goto invalid_keyword_type;
23836  if (kwds2) {
23837  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
23838  } else {
23839  goto invalid_keyword;
23840  }
23841  }
23842  return 0;
23843 arg_passed_twice:
23844  __Pyx_RaiseDoubleKeywordsError(function_name, key);
23845  goto bad;
23846 invalid_keyword_type:
23847  PyErr_Format(PyExc_TypeError,
23848  "%.200s() keywords must be strings", function_name);
23849  goto bad;
23850 invalid_keyword:
23851  PyErr_Format(PyExc_TypeError,
23852  #if PY_MAJOR_VERSION < 3
23853  "%.200s() got an unexpected keyword argument '%.200s'",
23854  function_name, PyString_AsString(key));
23855  #else
23856  "%s() got an unexpected keyword argument '%U'",
23857  function_name, key);
23858  #endif
23859 bad:
23860  return -1;
23861 }
23862 
23863 /* ArgTypeTest */
23864 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
23865 {
23866  if (unlikely(!type)) {
23867  PyErr_SetString(PyExc_SystemError, "Missing type object");
23868  return 0;
23869  }
23870  else if (exact) {
23871  #if PY_MAJOR_VERSION == 2
23872  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
23873  #endif
23874  }
23875  else {
23876  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
23877  }
23878  PyErr_Format(PyExc_TypeError,
23879  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
23880  name, type->tp_name, Py_TYPE(obj)->tp_name);
23881  return 0;
23882 }
23883 
23884 /* PyObjectGetAttrStr */
23885 #if CYTHON_USE_TYPE_SLOTS
23886 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23887  PyTypeObject* tp = Py_TYPE(obj);
23888  if (likely(tp->tp_getattro))
23889  return tp->tp_getattro(obj, attr_name);
23890 #if PY_MAJOR_VERSION < 3
23891  if (likely(tp->tp_getattr))
23892  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23893 #endif
23894  return PyObject_GetAttr(obj, attr_name);
23895 }
23896 #endif
23897 
23898 /* GetBuiltinName */
23899 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23900  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23901  if (unlikely(!result)) {
23902  PyErr_Format(PyExc_NameError,
23903 #if PY_MAJOR_VERSION >= 3
23904  "name '%U' is not defined", name);
23905 #else
23906  "name '%.200s' is not defined", PyString_AS_STRING(name));
23907 #endif
23908  }
23909  return result;
23910 }
23911 
23912 /* PyDictVersioning */
23913 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
23914 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
23915  PyObject *dict = Py_TYPE(obj)->tp_dict;
23916  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
23917 }
23918 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
23919  PyObject **dictptr = NULL;
23920  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
23921  if (offset) {
23922 #if CYTHON_COMPILING_IN_CPYTHON
23923  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
23924 #else
23925  dictptr = _PyObject_GetDictPtr(obj);
23926 #endif
23927  }
23928  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
23929 }
23930 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
23931  PyObject *dict = Py_TYPE(obj)->tp_dict;
23932  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
23933  return 0;
23934  return obj_dict_version == __Pyx_get_object_dict_version(obj);
23935 }
23936 #endif
23937 
23938 /* GetModuleGlobalName */
23939 #if CYTHON_USE_DICT_VERSIONS
23940 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
23941 #else
23942 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
23943 #endif
23944 {
23945  PyObject *result;
23946 #if !CYTHON_AVOID_BORROWED_REFS
23947 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
23948  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
23949  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23950  if (likely(result)) {
23951  return __Pyx_NewRef(result);
23952  } else if (unlikely(PyErr_Occurred())) {
23953  return NULL;
23954  }
23955 #else
23956  result = PyDict_GetItem(__pyx_d, name);
23957  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23958  if (likely(result)) {
23959  return __Pyx_NewRef(result);
23960  }
23961 #endif
23962 #else
23963  result = PyObject_GetItem(__pyx_d, name);
23964  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23965  if (likely(result)) {
23966  return __Pyx_NewRef(result);
23967  }
23968  PyErr_Clear();
23969 #endif
23970  return __Pyx_GetBuiltinName(name);
23971 }
23972 
23973 /* PyIntBinop */
23974 #if !CYTHON_COMPILING_IN_PYPY
23975 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
23976  (void)inplace;
23977  (void)zerodivision_check;
23978  #if PY_MAJOR_VERSION < 3
23979  if (likely(PyInt_CheckExact(op1))) {
23980  const long b = intval;
23981  long x;
23982  long a = PyInt_AS_LONG(op1);
23983  x = (long)((unsigned long)a + b);
23984  if (likely((x^a) >= 0 || (x^b) >= 0))
23985  return PyInt_FromLong(x);
23986  return PyLong_Type.tp_as_number->nb_add(op1, op2);
23987  }
23988  #endif
23989  #if CYTHON_USE_PYLONG_INTERNALS
23990  if (likely(PyLong_CheckExact(op1))) {
23991  const long b = intval;
23992  long a, x;
23993 #ifdef HAVE_LONG_LONG
23994  const PY_LONG_LONG llb = intval;
23995  PY_LONG_LONG lla, llx;
23996 #endif
23997  const digit* digits = ((PyLongObject*)op1)->ob_digit;
23998  const Py_ssize_t size = Py_SIZE(op1);
23999  if (likely(__Pyx_sst_abs(size) <= 1)) {
24000  a = likely(size) ? digits[0] : 0;
24001  if (size == -1) a = -a;
24002  } else {
24003  switch (size) {
24004  case -2:
24005  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24006  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24007  break;
24008 #ifdef HAVE_LONG_LONG
24009  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24010  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24011  goto long_long;
24012 #endif
24013  }
24014  CYTHON_FALLTHROUGH;
24015  case 2:
24016  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24017  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24018  break;
24019 #ifdef HAVE_LONG_LONG
24020  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24021  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24022  goto long_long;
24023 #endif
24024  }
24025  CYTHON_FALLTHROUGH;
24026  case -3:
24027  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24028  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24029  break;
24030 #ifdef HAVE_LONG_LONG
24031  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24032  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24033  goto long_long;
24034 #endif
24035  }
24036  CYTHON_FALLTHROUGH;
24037  case 3:
24038  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24039  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24040  break;
24041 #ifdef HAVE_LONG_LONG
24042  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24043  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24044  goto long_long;
24045 #endif
24046  }
24047  CYTHON_FALLTHROUGH;
24048  case -4:
24049  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24050  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24051  break;
24052 #ifdef HAVE_LONG_LONG
24053  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24054  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24055  goto long_long;
24056 #endif
24057  }
24058  CYTHON_FALLTHROUGH;
24059  case 4:
24060  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24061  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24062  break;
24063 #ifdef HAVE_LONG_LONG
24064  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24065  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24066  goto long_long;
24067 #endif
24068  }
24069  CYTHON_FALLTHROUGH;
24070  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
24071  }
24072  }
24073  x = a + b;
24074  return PyLong_FromLong(x);
24075 #ifdef HAVE_LONG_LONG
24076  long_long:
24077  llx = lla + llb;
24078  return PyLong_FromLongLong(llx);
24079 #endif
24080 
24081 
24082  }
24083  #endif
24084  if (PyFloat_CheckExact(op1)) {
24085  const long b = intval;
24086  double a = PyFloat_AS_DOUBLE(op1);
24087  double result;
24088  PyFPE_START_PROTECT("add", return NULL)
24089  result = ((double)a) + (double)b;
24090  PyFPE_END_PROTECT(result)
24091  return PyFloat_FromDouble(result);
24092  }
24093  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
24094 }
24095 #endif
24096 
24097 /* PyCFunctionFastCall */
24098 #if CYTHON_FAST_PYCCALL
24099 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24100  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24101  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24102  PyObject *self = PyCFunction_GET_SELF(func);
24103  int flags = PyCFunction_GET_FLAGS(func);
24104  assert(PyCFunction_Check(func));
24105  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24106  assert(nargs >= 0);
24107  assert(nargs == 0 || args != NULL);
24108  /* _PyCFunction_FastCallDict() must not be called with an exception set,
24109  because it may clear it (directly or indirectly) and so the
24110  caller loses its exception */
24111  assert(!PyErr_Occurred());
24112  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24113  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
24114  } else {
24115  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
24116  }
24117 }
24118 #endif
24119 
24120 /* PyFunctionFastCall */
24121 #if CYTHON_FAST_PYCALL
24122 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24123  PyObject *globals) {
24124  PyFrameObject *f;
24125  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24126  PyObject **fastlocals;
24127  Py_ssize_t i;
24128  PyObject *result;
24129  assert(globals != NULL);
24130  /* XXX Perhaps we should create a specialized
24131  PyFrame_New() that doesn't take locals, but does
24132  take builtins without sanity checking them.
24133  */
24134  assert(tstate != NULL);
24135  f = PyFrame_New(tstate, co, globals, NULL);
24136  if (f == NULL) {
24137  return NULL;
24138  }
24139  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
24140  for (i = 0; i < na; i++) {
24141  Py_INCREF(*args);
24142  fastlocals[i] = *args++;
24143  }
24144  result = PyEval_EvalFrameEx(f,0);
24145  ++tstate->recursion_depth;
24146  Py_DECREF(f);
24147  --tstate->recursion_depth;
24148  return result;
24149 }
24150 #if 1 || PY_VERSION_HEX < 0x030600B1
24151 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24152  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24153  PyObject *globals = PyFunction_GET_GLOBALS(func);
24154  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24155  PyObject *closure;
24156 #if PY_MAJOR_VERSION >= 3
24157  PyObject *kwdefs;
24158 #endif
24159  PyObject *kwtuple, **k;
24160  PyObject **d;
24161  Py_ssize_t nd;
24162  Py_ssize_t nk;
24163  PyObject *result;
24164  assert(kwargs == NULL || PyDict_Check(kwargs));
24165  nk = kwargs ? PyDict_Size(kwargs) : 0;
24166  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
24167  return NULL;
24168  }
24169  if (
24170 #if PY_MAJOR_VERSION >= 3
24171  co->co_kwonlyargcount == 0 &&
24172 #endif
24173  likely(kwargs == NULL || nk == 0) &&
24174  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24175  if (argdefs == NULL && co->co_argcount == nargs) {
24176  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24177  goto done;
24178  }
24179  else if (nargs == 0 && argdefs != NULL
24180  && co->co_argcount == Py_SIZE(argdefs)) {
24181  /* function called with no arguments, but all parameters have
24182  a default value: use default values as arguments .*/
24183  args = &PyTuple_GET_ITEM(argdefs, 0);
24184  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24185  goto done;
24186  }
24187  }
24188  if (kwargs != NULL) {
24189  Py_ssize_t pos, i;
24190  kwtuple = PyTuple_New(2 * nk);
24191  if (kwtuple == NULL) {
24192  result = NULL;
24193  goto done;
24194  }
24195  k = &PyTuple_GET_ITEM(kwtuple, 0);
24196  pos = i = 0;
24197  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24198  Py_INCREF(k[i]);
24199  Py_INCREF(k[i+1]);
24200  i += 2;
24201  }
24202  nk = i / 2;
24203  }
24204  else {
24205  kwtuple = NULL;
24206  k = NULL;
24207  }
24208  closure = PyFunction_GET_CLOSURE(func);
24209 #if PY_MAJOR_VERSION >= 3
24210  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24211 #endif
24212  if (argdefs != NULL) {
24213  d = &PyTuple_GET_ITEM(argdefs, 0);
24214  nd = Py_SIZE(argdefs);
24215  }
24216  else {
24217  d = NULL;
24218  nd = 0;
24219  }
24220 #if PY_MAJOR_VERSION >= 3
24221  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24222  args, (int)nargs,
24223  k, (int)nk,
24224  d, (int)nd, kwdefs, closure);
24225 #else
24226  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24227  args, (int)nargs,
24228  k, (int)nk,
24229  d, (int)nd, closure);
24230 #endif
24231  Py_XDECREF(kwtuple);
24232 done:
24233  Py_LeaveRecursiveCall();
24234  return result;
24235 }
24236 #endif
24237 #endif
24238 
24239 /* PyObjectCall */
24240 #if CYTHON_COMPILING_IN_CPYTHON
24241 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24242  PyObject *result;
24243  ternaryfunc call = Py_TYPE(func)->tp_call;
24244  if (unlikely(!call))
24245  return PyObject_Call(func, arg, kw);
24246  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24247  return NULL;
24248  result = (*call)(func, arg, kw);
24249  Py_LeaveRecursiveCall();
24250  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24251  PyErr_SetString(
24252  PyExc_SystemError,
24253  "NULL result without error in PyObject_Call");
24254  }
24255  return result;
24256 }
24257 #endif
24258 
24259 /* PyObjectCall2Args */
24260 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
24261  PyObject *args, *result = NULL;
24262  #if CYTHON_FAST_PYCALL
24263  if (PyFunction_Check(function)) {
24264  PyObject *args[2] = {arg1, arg2};
24265  return __Pyx_PyFunction_FastCall(function, args, 2);
24266  }
24267  #endif
24268  #if CYTHON_FAST_PYCCALL
24269  if (__Pyx_PyFastCFunction_Check(function)) {
24270  PyObject *args[2] = {arg1, arg2};
24271  return __Pyx_PyCFunction_FastCall(function, args, 2);
24272  }
24273  #endif
24274  args = PyTuple_New(2);
24275  if (unlikely(!args)) goto done;
24276  Py_INCREF(arg1);
24277  PyTuple_SET_ITEM(args, 0, arg1);
24278  Py_INCREF(arg2);
24279  PyTuple_SET_ITEM(args, 1, arg2);
24280  Py_INCREF(function);
24281  result = __Pyx_PyObject_Call(function, args, NULL);
24282  Py_DECREF(args);
24283  Py_DECREF(function);
24284 done:
24285  return result;
24286 }
24287 
24288 /* PyObjectCallMethO */
24289 #if CYTHON_COMPILING_IN_CPYTHON
24290 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24291  PyObject *self, *result;
24292  PyCFunction cfunc;
24293  cfunc = PyCFunction_GET_FUNCTION(func);
24294  self = PyCFunction_GET_SELF(func);
24295  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24296  return NULL;
24297  result = cfunc(self, arg);
24298  Py_LeaveRecursiveCall();
24299  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24300  PyErr_SetString(
24301  PyExc_SystemError,
24302  "NULL result without error in PyObject_Call");
24303  }
24304  return result;
24305 }
24306 #endif
24307 
24308 /* PyObjectCallOneArg */
24309 #if CYTHON_COMPILING_IN_CPYTHON
24310 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24311  PyObject *result;
24312  PyObject *args = PyTuple_New(1);
24313  if (unlikely(!args)) return NULL;
24314  Py_INCREF(arg);
24315  PyTuple_SET_ITEM(args, 0, arg);
24316  result = __Pyx_PyObject_Call(func, args, NULL);
24317  Py_DECREF(args);
24318  return result;
24319 }
24320 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24321 #if CYTHON_FAST_PYCALL
24322  if (PyFunction_Check(func)) {
24323  return __Pyx_PyFunction_FastCall(func, &arg, 1);
24324  }
24325 #endif
24326  if (likely(PyCFunction_Check(func))) {
24327  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24328  return __Pyx_PyObject_CallMethO(func, arg);
24329 #if CYTHON_FAST_PYCCALL
24330  } else if (__Pyx_PyFastCFunction_Check(func)) {
24331  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24332 #endif
24333  }
24334  }
24335  return __Pyx__PyObject_CallOneArg(func, arg);
24336 }
24337 #else
24338 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24339  PyObject *result;
24340  PyObject *args = PyTuple_Pack(1, arg);
24341  if (unlikely(!args)) return NULL;
24342  result = __Pyx_PyObject_Call(func, args, NULL);
24343  Py_DECREF(args);
24344  return result;
24345 }
24346 #endif
24347 
24348 /* PyObjectCallNoArg */
24349 #if CYTHON_COMPILING_IN_CPYTHON
24350 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24351 #if CYTHON_FAST_PYCALL
24352  if (PyFunction_Check(func)) {
24353  return __Pyx_PyFunction_FastCall(func, NULL, 0);
24354  }
24355 #endif
24356 #ifdef __Pyx_CyFunction_USED
24357  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
24358 #else
24359  if (likely(PyCFunction_Check(func)))
24360 #endif
24361  {
24362  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24363  return __Pyx_PyObject_CallMethO(func, NULL);
24364  }
24365  }
24366  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24367 }
24368 #endif
24369 
24370 /* GetTopmostException */
24371 #if CYTHON_USE_EXC_INFO_STACK
24372 static _PyErr_StackItem *
24373 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
24374 {
24375  _PyErr_StackItem *exc_info = tstate->exc_info;
24376  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
24377  exc_info->previous_item != NULL)
24378  {
24379  exc_info = exc_info->previous_item;
24380  }
24381  return exc_info;
24382 }
24383 #endif
24384 
24385 /* SaveResetException */
24386 #if CYTHON_FAST_THREAD_STATE
24387 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24388  #if CYTHON_USE_EXC_INFO_STACK
24389  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
24390  *type = exc_info->exc_type;
24391  *value = exc_info->exc_value;
24392  *tb = exc_info->exc_traceback;
24393  #else
24394  *type = tstate->exc_type;
24395  *value = tstate->exc_value;
24396  *tb = tstate->exc_traceback;
24397  #endif
24398  Py_XINCREF(*type);
24399  Py_XINCREF(*value);
24400  Py_XINCREF(*tb);
24401 }
24402 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24403  PyObject *tmp_type, *tmp_value, *tmp_tb;
24404  #if CYTHON_USE_EXC_INFO_STACK
24405  _PyErr_StackItem *exc_info = tstate->exc_info;
24406  tmp_type = exc_info->exc_type;
24407  tmp_value = exc_info->exc_value;
24408  tmp_tb = exc_info->exc_traceback;
24409  exc_info->exc_type = type;
24410  exc_info->exc_value = value;
24411  exc_info->exc_traceback = tb;
24412  #else
24413  tmp_type = tstate->exc_type;
24414  tmp_value = tstate->exc_value;
24415  tmp_tb = tstate->exc_traceback;
24416  tstate->exc_type = type;
24417  tstate->exc_value = value;
24418  tstate->exc_traceback = tb;
24419  #endif
24420  Py_XDECREF(tmp_type);
24421  Py_XDECREF(tmp_value);
24422  Py_XDECREF(tmp_tb);
24423 }
24424 #endif
24425 
24426 /* PyErrExceptionMatches */
24427 #if CYTHON_FAST_THREAD_STATE
24428 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24429  Py_ssize_t i, n;
24430  n = PyTuple_GET_SIZE(tuple);
24431 #if PY_MAJOR_VERSION >= 3
24432  for (i=0; i<n; i++) {
24433  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
24434  }
24435 #endif
24436  for (i=0; i<n; i++) {
24437  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
24438  }
24439  return 0;
24440 }
24441 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24442  PyObject *exc_type = tstate->curexc_type;
24443  if (exc_type == err) return 1;
24444  if (unlikely(!exc_type)) return 0;
24445  if (unlikely(PyTuple_Check(err)))
24446  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24447  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24448 }
24449 #endif
24450 
24451 /* GetException */
24452 #if CYTHON_FAST_THREAD_STATE
24453 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
24454 #else
24455 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
24456 #endif
24457 {
24458  PyObject *local_type, *local_value, *local_tb;
24459 #if CYTHON_FAST_THREAD_STATE
24460  PyObject *tmp_type, *tmp_value, *tmp_tb;
24461  local_type = tstate->curexc_type;
24462  local_value = tstate->curexc_value;
24463  local_tb = tstate->curexc_traceback;
24464  tstate->curexc_type = 0;
24465  tstate->curexc_value = 0;
24466  tstate->curexc_traceback = 0;
24467 #else
24468  PyErr_Fetch(&local_type, &local_value, &local_tb);
24469 #endif
24470  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
24471 #if CYTHON_FAST_THREAD_STATE
24472  if (unlikely(tstate->curexc_type))
24473 #else
24474  if (unlikely(PyErr_Occurred()))
24475 #endif
24476  goto bad;
24477  #if PY_MAJOR_VERSION >= 3
24478  if (local_tb) {
24479  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
24480  goto bad;
24481  }
24482  #endif
24483  Py_XINCREF(local_tb);
24484  Py_XINCREF(local_type);
24485  Py_XINCREF(local_value);
24486  *type = local_type;
24487  *value = local_value;
24488  *tb = local_tb;
24489 #if CYTHON_FAST_THREAD_STATE
24490  #if CYTHON_USE_EXC_INFO_STACK
24491  {
24492  _PyErr_StackItem *exc_info = tstate->exc_info;
24493  tmp_type = exc_info->exc_type;
24494  tmp_value = exc_info->exc_value;
24495  tmp_tb = exc_info->exc_traceback;
24496  exc_info->exc_type = local_type;
24497  exc_info->exc_value = local_value;
24498  exc_info->exc_traceback = local_tb;
24499  }
24500  #else
24501  tmp_type = tstate->exc_type;
24502  tmp_value = tstate->exc_value;
24503  tmp_tb = tstate->exc_traceback;
24504  tstate->exc_type = local_type;
24505  tstate->exc_value = local_value;
24506  tstate->exc_traceback = local_tb;
24507  #endif
24508  Py_XDECREF(tmp_type);
24509  Py_XDECREF(tmp_value);
24510  Py_XDECREF(tmp_tb);
24511 #else
24512  PyErr_SetExcInfo(local_type, local_value, local_tb);
24513 #endif
24514  return 0;
24515 bad:
24516  *type = 0;
24517  *value = 0;
24518  *tb = 0;
24519  Py_XDECREF(local_type);
24520  Py_XDECREF(local_value);
24521  Py_XDECREF(local_tb);
24522  return -1;
24523 }
24524 
24525 /* PyErrFetchRestore */
24526 #if CYTHON_FAST_THREAD_STATE
24527 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24528  PyObject *tmp_type, *tmp_value, *tmp_tb;
24529  tmp_type = tstate->curexc_type;
24530  tmp_value = tstate->curexc_value;
24531  tmp_tb = tstate->curexc_traceback;
24532  tstate->curexc_type = type;
24533  tstate->curexc_value = value;
24534  tstate->curexc_traceback = tb;
24535  Py_XDECREF(tmp_type);
24536  Py_XDECREF(tmp_value);
24537  Py_XDECREF(tmp_tb);
24538 }
24539 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24540  *type = tstate->curexc_type;
24541  *value = tstate->curexc_value;
24542  *tb = tstate->curexc_traceback;
24543  tstate->curexc_type = 0;
24544  tstate->curexc_value = 0;
24545  tstate->curexc_traceback = 0;
24546 }
24547 #endif
24548 
24549 /* RaiseException */
24550 #if PY_MAJOR_VERSION < 3
24551 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24552  CYTHON_UNUSED PyObject *cause) {
24553  __Pyx_PyThreadState_declare
24554  Py_XINCREF(type);
24555  if (!value || value == Py_None)
24556  value = NULL;
24557  else
24558  Py_INCREF(value);
24559  if (!tb || tb == Py_None)
24560  tb = NULL;
24561  else {
24562  Py_INCREF(tb);
24563  if (!PyTraceBack_Check(tb)) {
24564  PyErr_SetString(PyExc_TypeError,
24565  "raise: arg 3 must be a traceback or None");
24566  goto raise_error;
24567  }
24568  }
24569  if (PyType_Check(type)) {
24570 #if CYTHON_COMPILING_IN_PYPY
24571  if (!value) {
24572  Py_INCREF(Py_None);
24573  value = Py_None;
24574  }
24575 #endif
24576  PyErr_NormalizeException(&type, &value, &tb);
24577  } else {
24578  if (value) {
24579  PyErr_SetString(PyExc_TypeError,
24580  "instance exception may not have a separate value");
24581  goto raise_error;
24582  }
24583  value = type;
24584  type = (PyObject*) Py_TYPE(type);
24585  Py_INCREF(type);
24586  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24587  PyErr_SetString(PyExc_TypeError,
24588  "raise: exception class must be a subclass of BaseException");
24589  goto raise_error;
24590  }
24591  }
24592  __Pyx_PyThreadState_assign
24593  __Pyx_ErrRestore(type, value, tb);
24594  return;
24595 raise_error:
24596  Py_XDECREF(value);
24597  Py_XDECREF(type);
24598  Py_XDECREF(tb);
24599  return;
24600 }
24601 #else
24602 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24603  PyObject* owned_instance = NULL;
24604  if (tb == Py_None) {
24605  tb = 0;
24606  } else if (tb && !PyTraceBack_Check(tb)) {
24607  PyErr_SetString(PyExc_TypeError,
24608  "raise: arg 3 must be a traceback or None");
24609  goto bad;
24610  }
24611  if (value == Py_None)
24612  value = 0;
24613  if (PyExceptionInstance_Check(type)) {
24614  if (value) {
24615  PyErr_SetString(PyExc_TypeError,
24616  "instance exception may not have a separate value");
24617  goto bad;
24618  }
24619  value = type;
24620  type = (PyObject*) Py_TYPE(value);
24621  } else if (PyExceptionClass_Check(type)) {
24622  PyObject *instance_class = NULL;
24623  if (value && PyExceptionInstance_Check(value)) {
24624  instance_class = (PyObject*) Py_TYPE(value);
24625  if (instance_class != type) {
24626  int is_subclass = PyObject_IsSubclass(instance_class, type);
24627  if (!is_subclass) {
24628  instance_class = NULL;
24629  } else if (unlikely(is_subclass == -1)) {
24630  goto bad;
24631  } else {
24632  type = instance_class;
24633  }
24634  }
24635  }
24636  if (!instance_class) {
24637  PyObject *args;
24638  if (!value)
24639  args = PyTuple_New(0);
24640  else if (PyTuple_Check(value)) {
24641  Py_INCREF(value);
24642  args = value;
24643  } else
24644  args = PyTuple_Pack(1, value);
24645  if (!args)
24646  goto bad;
24647  owned_instance = PyObject_Call(type, args, NULL);
24648  Py_DECREF(args);
24649  if (!owned_instance)
24650  goto bad;
24651  value = owned_instance;
24652  if (!PyExceptionInstance_Check(value)) {
24653  PyErr_Format(PyExc_TypeError,
24654  "calling %R should have returned an instance of "
24655  "BaseException, not %R",
24656  type, Py_TYPE(value));
24657  goto bad;
24658  }
24659  }
24660  } else {
24661  PyErr_SetString(PyExc_TypeError,
24662  "raise: exception class must be a subclass of BaseException");
24663  goto bad;
24664  }
24665  if (cause) {
24666  PyObject *fixed_cause;
24667  if (cause == Py_None) {
24668  fixed_cause = NULL;
24669  } else if (PyExceptionClass_Check(cause)) {
24670  fixed_cause = PyObject_CallObject(cause, NULL);
24671  if (fixed_cause == NULL)
24672  goto bad;
24673  } else if (PyExceptionInstance_Check(cause)) {
24674  fixed_cause = cause;
24675  Py_INCREF(fixed_cause);
24676  } else {
24677  PyErr_SetString(PyExc_TypeError,
24678  "exception causes must derive from "
24679  "BaseException");
24680  goto bad;
24681  }
24682  PyException_SetCause(value, fixed_cause);
24683  }
24684  PyErr_SetObject(type, value);
24685  if (tb) {
24686 #if CYTHON_COMPILING_IN_PYPY
24687  PyObject *tmp_type, *tmp_value, *tmp_tb;
24688  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24689  Py_INCREF(tb);
24690  PyErr_Restore(tmp_type, tmp_value, tb);
24691  Py_XDECREF(tmp_tb);
24692 #else
24693  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24694  PyObject* tmp_tb = tstate->curexc_traceback;
24695  if (tb != tmp_tb) {
24696  Py_INCREF(tb);
24697  tstate->curexc_traceback = tb;
24698  Py_XDECREF(tmp_tb);
24699  }
24700 #endif
24701  }
24702 bad:
24703  Py_XDECREF(owned_instance);
24704  return;
24705 }
24706 #endif
24707 
24708 /* BytesEquals */
24709 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
24710 #if CYTHON_COMPILING_IN_PYPY
24711  return PyObject_RichCompareBool(s1, s2, equals);
24712 #else
24713  if (s1 == s2) {
24714  return (equals == Py_EQ);
24715  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
24716  const char *ps1, *ps2;
24717  Py_ssize_t length = PyBytes_GET_SIZE(s1);
24718  if (length != PyBytes_GET_SIZE(s2))
24719  return (equals == Py_NE);
24720  ps1 = PyBytes_AS_STRING(s1);
24721  ps2 = PyBytes_AS_STRING(s2);
24722  if (ps1[0] != ps2[0]) {
24723  return (equals == Py_NE);
24724  } else if (length == 1) {
24725  return (equals == Py_EQ);
24726  } else {
24727  int result;
24728 #if CYTHON_USE_UNICODE_INTERNALS
24729  Py_hash_t hash1, hash2;
24730  hash1 = ((PyBytesObject*)s1)->ob_shash;
24731  hash2 = ((PyBytesObject*)s2)->ob_shash;
24732  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24733  return (equals == Py_NE);
24734  }
24735 #endif
24736  result = memcmp(ps1, ps2, (size_t)length);
24737  return (equals == Py_EQ) ? (result == 0) : (result != 0);
24738  }
24739  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
24740  return (equals == Py_NE);
24741  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
24742  return (equals == Py_NE);
24743  } else {
24744  int result;
24745  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24746  if (!py_result)
24747  return -1;
24748  result = __Pyx_PyObject_IsTrue(py_result);
24749  Py_DECREF(py_result);
24750  return result;
24751  }
24752 #endif
24753 }
24754 
24755 /* UnicodeEquals */
24756 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
24757 #if CYTHON_COMPILING_IN_PYPY
24758  return PyObject_RichCompareBool(s1, s2, equals);
24759 #else
24760 #if PY_MAJOR_VERSION < 3
24761  PyObject* owned_ref = NULL;
24762 #endif
24763  int s1_is_unicode, s2_is_unicode;
24764  if (s1 == s2) {
24765  goto return_eq;
24766  }
24767  s1_is_unicode = PyUnicode_CheckExact(s1);
24768  s2_is_unicode = PyUnicode_CheckExact(s2);
24769 #if PY_MAJOR_VERSION < 3
24770  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
24771  owned_ref = PyUnicode_FromObject(s2);
24772  if (unlikely(!owned_ref))
24773  return -1;
24774  s2 = owned_ref;
24775  s2_is_unicode = 1;
24776  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
24777  owned_ref = PyUnicode_FromObject(s1);
24778  if (unlikely(!owned_ref))
24779  return -1;
24780  s1 = owned_ref;
24781  s1_is_unicode = 1;
24782  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
24783  return __Pyx_PyBytes_Equals(s1, s2, equals);
24784  }
24785 #endif
24786  if (s1_is_unicode & s2_is_unicode) {
24787  Py_ssize_t length;
24788  int kind;
24789  void *data1, *data2;
24790  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
24791  return -1;
24792  length = __Pyx_PyUnicode_GET_LENGTH(s1);
24793  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
24794  goto return_ne;
24795  }
24796 #if CYTHON_USE_UNICODE_INTERNALS
24797  {
24798  Py_hash_t hash1, hash2;
24799  #if CYTHON_PEP393_ENABLED
24800  hash1 = ((PyASCIIObject*)s1)->hash;
24801  hash2 = ((PyASCIIObject*)s2)->hash;
24802  #else
24803  hash1 = ((PyUnicodeObject*)s1)->hash;
24804  hash2 = ((PyUnicodeObject*)s2)->hash;
24805  #endif
24806  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24807  goto return_ne;
24808  }
24809  }
24810 #endif
24811  kind = __Pyx_PyUnicode_KIND(s1);
24812  if (kind != __Pyx_PyUnicode_KIND(s2)) {
24813  goto return_ne;
24814  }
24815  data1 = __Pyx_PyUnicode_DATA(s1);
24816  data2 = __Pyx_PyUnicode_DATA(s2);
24817  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
24818  goto return_ne;
24819  } else if (length == 1) {
24820  goto return_eq;
24821  } else {
24822  int result = memcmp(data1, data2, (size_t)(length * kind));
24823  #if PY_MAJOR_VERSION < 3
24824  Py_XDECREF(owned_ref);
24825  #endif
24826  return (equals == Py_EQ) ? (result == 0) : (result != 0);
24827  }
24828  } else if ((s1 == Py_None) & s2_is_unicode) {
24829  goto return_ne;
24830  } else if ((s2 == Py_None) & s1_is_unicode) {
24831  goto return_ne;
24832  } else {
24833  int result;
24834  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24835  #if PY_MAJOR_VERSION < 3
24836  Py_XDECREF(owned_ref);
24837  #endif
24838  if (!py_result)
24839  return -1;
24840  result = __Pyx_PyObject_IsTrue(py_result);
24841  Py_DECREF(py_result);
24842  return result;
24843  }
24844 return_eq:
24845  #if PY_MAJOR_VERSION < 3
24846  Py_XDECREF(owned_ref);
24847  #endif
24848  return (equals == Py_EQ);
24849 return_ne:
24850  #if PY_MAJOR_VERSION < 3
24851  Py_XDECREF(owned_ref);
24852  #endif
24853  return (equals == Py_NE);
24854 #endif
24855 }
24856 
24857 /* None */
24858 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
24859  Py_ssize_t q = a / b;
24860  Py_ssize_t r = a - q*b;
24861  q -= ((r != 0) & ((r ^ b) < 0));
24862  return q;
24863 }
24864 
24865 /* GetAttr */
24866 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
24867 #if CYTHON_USE_TYPE_SLOTS
24868 #if PY_MAJOR_VERSION >= 3
24869  if (likely(PyUnicode_Check(n)))
24870 #else
24871  if (likely(PyString_Check(n)))
24872 #endif
24873  return __Pyx_PyObject_GetAttrStr(o, n);
24874 #endif
24875  return PyObject_GetAttr(o, n);
24876 }
24877 
24878 /* GetItemInt */
24879 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24880  PyObject *r;
24881  if (!j) return NULL;
24882  r = PyObject_GetItem(o, j);
24883  Py_DECREF(j);
24884  return r;
24885 }
24886 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24887  CYTHON_NCP_UNUSED int wraparound,
24888  CYTHON_NCP_UNUSED int boundscheck) {
24889 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24890  Py_ssize_t wrapped_i = i;
24891  if (wraparound & unlikely(i < 0)) {
24892  wrapped_i += PyList_GET_SIZE(o);
24893  }
24894  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24895  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
24896  Py_INCREF(r);
24897  return r;
24898  }
24899  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24900 #else
24901  return PySequence_GetItem(o, i);
24902 #endif
24903 }
24904 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24905  CYTHON_NCP_UNUSED int wraparound,
24906  CYTHON_NCP_UNUSED int boundscheck) {
24907 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24908  Py_ssize_t wrapped_i = i;
24909  if (wraparound & unlikely(i < 0)) {
24910  wrapped_i += PyTuple_GET_SIZE(o);
24911  }
24912  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24913  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
24914  Py_INCREF(r);
24915  return r;
24916  }
24917  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24918 #else
24919  return PySequence_GetItem(o, i);
24920 #endif
24921 }
24922 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
24923  CYTHON_NCP_UNUSED int wraparound,
24924  CYTHON_NCP_UNUSED int boundscheck) {
24925 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24926  if (is_list || PyList_CheckExact(o)) {
24927  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24928  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
24929  PyObject *r = PyList_GET_ITEM(o, n);
24930  Py_INCREF(r);
24931  return r;
24932  }
24933  }
24934  else if (PyTuple_CheckExact(o)) {
24935  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24936  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
24937  PyObject *r = PyTuple_GET_ITEM(o, n);
24938  Py_INCREF(r);
24939  return r;
24940  }
24941  } else {
24942  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24943  if (likely(m && m->sq_item)) {
24944  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24945  Py_ssize_t l = m->sq_length(o);
24946  if (likely(l >= 0)) {
24947  i += l;
24948  } else {
24949  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24950  return NULL;
24951  PyErr_Clear();
24952  }
24953  }
24954  return m->sq_item(o, i);
24955  }
24956  }
24957 #else
24958  if (is_list || PySequence_Check(o)) {
24959  return PySequence_GetItem(o, i);
24960  }
24961 #endif
24962  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24963 }
24964 
24965 /* ObjectGetItem */
24966 #if CYTHON_USE_TYPE_SLOTS
24967 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24968  PyObject *runerr;
24969  Py_ssize_t key_value;
24970  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24971  if (unlikely(!(m && m->sq_item))) {
24972  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24973  return NULL;
24974  }
24975  key_value = __Pyx_PyIndex_AsSsize_t(index);
24976  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24977  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24978  }
24979  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24980  PyErr_Clear();
24981  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24982  }
24983  return NULL;
24984 }
24985 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24986  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24987  if (likely(m && m->mp_subscript)) {
24988  return m->mp_subscript(obj, key);
24989  }
24990  return __Pyx_PyObject_GetIndex(obj, key);
24991 }
24992 #endif
24993 
24994 /* decode_c_string */
24995 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
24996  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
24997  const char* encoding, const char* errors,
24998  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
24999  Py_ssize_t length;
25000  if (unlikely((start < 0) | (stop < 0))) {
25001  size_t slen = strlen(cstring);
25002  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
25003  PyErr_SetString(PyExc_OverflowError,
25004  "c-string too long to convert to Python");
25005  return NULL;
25006  }
25007  length = (Py_ssize_t) slen;
25008  if (start < 0) {
25009  start += length;
25010  if (start < 0)
25011  start = 0;
25012  }
25013  if (stop < 0)
25014  stop += length;
25015  }
25016  if (unlikely(stop <= start))
25017  return __Pyx_NewRef(__pyx_empty_unicode);
25018  length = stop - start;
25019  cstring += start;
25020  if (decode_func) {
25021  return decode_func(cstring, length, errors);
25022  } else {
25023  return PyUnicode_Decode(cstring, length, encoding, errors);
25024  }
25025 }
25026 
25027 /* GetAttr3 */
25028 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25029  __Pyx_PyThreadState_declare
25030  __Pyx_PyThreadState_assign
25031  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25032  return NULL;
25033  __Pyx_PyErr_Clear();
25034  Py_INCREF(d);
25035  return d;
25036 }
25037 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
25038  PyObject *r = __Pyx_GetAttr(o, n);
25039  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
25040 }
25041 
25042 /* RaiseTooManyValuesToUnpack */
25043 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25044  PyErr_Format(PyExc_ValueError,
25045  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
25046 }
25047 
25048 /* RaiseNeedMoreValuesToUnpack */
25049 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25050  PyErr_Format(PyExc_ValueError,
25051  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
25052  index, (index == 1) ? "" : "s");
25053 }
25054 
25055 /* RaiseNoneIterError */
25056 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
25057  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
25058 }
25059 
25060 /* ExtTypeTest */
25061 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
25062  if (unlikely(!type)) {
25063  PyErr_SetString(PyExc_SystemError, "Missing type object");
25064  return 0;
25065  }
25066  if (likely(__Pyx_TypeCheck(obj, type)))
25067  return 1;
25068  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
25069  Py_TYPE(obj)->tp_name, type->tp_name);
25070  return 0;
25071 }
25072 
25073 /* SwapException */
25074 #if CYTHON_FAST_THREAD_STATE
25075 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25076  PyObject *tmp_type, *tmp_value, *tmp_tb;
25077  #if CYTHON_USE_EXC_INFO_STACK
25078  _PyErr_StackItem *exc_info = tstate->exc_info;
25079  tmp_type = exc_info->exc_type;
25080  tmp_value = exc_info->exc_value;
25081  tmp_tb = exc_info->exc_traceback;
25082  exc_info->exc_type = *type;
25083  exc_info->exc_value = *value;
25084  exc_info->exc_traceback = *tb;
25085  #else
25086  tmp_type = tstate->exc_type;
25087  tmp_value = tstate->exc_value;
25088  tmp_tb = tstate->exc_traceback;
25089  tstate->exc_type = *type;
25090  tstate->exc_value = *value;
25091  tstate->exc_traceback = *tb;
25092  #endif
25093  *type = tmp_type;
25094  *value = tmp_value;
25095  *tb = tmp_tb;
25096 }
25097 #else
25098 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25099  PyObject *tmp_type, *tmp_value, *tmp_tb;
25100  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25101  PyErr_SetExcInfo(*type, *value, *tb);
25102  *type = tmp_type;
25103  *value = tmp_value;
25104  *tb = tmp_tb;
25105 }
25106 #endif
25107 
25108 /* Import */
25109 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
25110  PyObject *empty_list = 0;
25111  PyObject *module = 0;
25112  PyObject *global_dict = 0;
25113  PyObject *empty_dict = 0;
25114  PyObject *list;
25115  #if PY_MAJOR_VERSION < 3
25116  PyObject *py_import;
25117  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25118  if (!py_import)
25119  goto bad;
25120  #endif
25121  if (from_list)
25122  list = from_list;
25123  else {
25124  empty_list = PyList_New(0);
25125  if (!empty_list)
25126  goto bad;
25127  list = empty_list;
25128  }
25129  global_dict = PyModule_GetDict(__pyx_m);
25130  if (!global_dict)
25131  goto bad;
25132  empty_dict = PyDict_New();
25133  if (!empty_dict)
25134  goto bad;
25135  {
25136  #if PY_MAJOR_VERSION >= 3
25137  if (level == -1) {
25138  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
25139  module = PyImport_ImportModuleLevelObject(
25140  name, global_dict, empty_dict, list, 1);
25141  if (!module) {
25142  if (!PyErr_ExceptionMatches(PyExc_ImportError))
25143  goto bad;
25144  PyErr_Clear();
25145  }
25146  }
25147  level = 0;
25148  }
25149  #endif
25150  if (!module) {
25151  #if PY_MAJOR_VERSION < 3
25152  PyObject *py_level = PyInt_FromLong(level);
25153  if (!py_level)
25154  goto bad;
25155  module = PyObject_CallFunctionObjArgs(py_import,
25156  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25157  Py_DECREF(py_level);
25158  #else
25159  module = PyImport_ImportModuleLevelObject(
25160  name, global_dict, empty_dict, list, level);
25161  #endif
25162  }
25163  }
25164 bad:
25165  #if PY_MAJOR_VERSION < 3
25166  Py_XDECREF(py_import);
25167  #endif
25168  Py_XDECREF(empty_list);
25169  Py_XDECREF(empty_dict);
25170  return module;
25171 }
25172 
25173 /* FastTypeChecks */
25174 #if CYTHON_COMPILING_IN_CPYTHON
25175 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25176  while (a) {
25177  a = a->tp_base;
25178  if (a == b)
25179  return 1;
25180  }
25181  return b == &PyBaseObject_Type;
25182 }
25183 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25184  PyObject *mro;
25185  if (a == b) return 1;
25186  mro = a->tp_mro;
25187  if (likely(mro)) {
25188  Py_ssize_t i, n;
25189  n = PyTuple_GET_SIZE(mro);
25190  for (i = 0; i < n; i++) {
25191  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25192  return 1;
25193  }
25194  return 0;
25195  }
25196  return __Pyx_InBases(a, b);
25197 }
25198 #if PY_MAJOR_VERSION == 2
25199 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25200  PyObject *exception, *value, *tb;
25201  int res;
25202  __Pyx_PyThreadState_declare
25203  __Pyx_PyThreadState_assign
25204  __Pyx_ErrFetch(&exception, &value, &tb);
25205  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25206  if (unlikely(res == -1)) {
25207  PyErr_WriteUnraisable(err);
25208  res = 0;
25209  }
25210  if (!res) {
25211  res = PyObject_IsSubclass(err, exc_type2);
25212  if (unlikely(res == -1)) {
25213  PyErr_WriteUnraisable(err);
25214  res = 0;
25215  }
25216  }
25217  __Pyx_ErrRestore(exception, value, tb);
25218  return res;
25219 }
25220 #else
25221 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25222  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25223  if (!res) {
25224  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25225  }
25226  return res;
25227 }
25228 #endif
25229 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25230  Py_ssize_t i, n;
25231  assert(PyExceptionClass_Check(exc_type));
25232  n = PyTuple_GET_SIZE(tuple);
25233 #if PY_MAJOR_VERSION >= 3
25234  for (i=0; i<n; i++) {
25235  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25236  }
25237 #endif
25238  for (i=0; i<n; i++) {
25239  PyObject *t = PyTuple_GET_ITEM(tuple, i);
25240  #if PY_MAJOR_VERSION < 3
25241  if (likely(exc_type == t)) return 1;
25242  #endif
25243  if (likely(PyExceptionClass_Check(t))) {
25244  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
25245  } else {
25246  }
25247  }
25248  return 0;
25249 }
25250 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25251  if (likely(err == exc_type)) return 1;
25252  if (likely(PyExceptionClass_Check(err))) {
25253  if (likely(PyExceptionClass_Check(exc_type))) {
25254  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25255  } else if (likely(PyTuple_Check(exc_type))) {
25256  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25257  } else {
25258  }
25259  }
25260  return PyErr_GivenExceptionMatches(err, exc_type);
25261 }
25262 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25263  assert(PyExceptionClass_Check(exc_type1));
25264  assert(PyExceptionClass_Check(exc_type2));
25265  if (likely(err == exc_type1 || err == exc_type2)) return 1;
25266  if (likely(PyExceptionClass_Check(err))) {
25267  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25268  }
25269  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25270 }
25271 #endif
25272 
25273 /* None */
25274 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
25275  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
25276 }
25277 
25278 /* None */
25279 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
25280  long q = a / b;
25281  long r = a - q*b;
25282  q -= ((r != 0) & ((r ^ b) < 0));
25283  return q;
25284 }
25285 
25286 /* ImportFrom */
25287 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25288  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25289  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25290  PyErr_Format(PyExc_ImportError,
25291  #if PY_MAJOR_VERSION < 3
25292  "cannot import name %.230s", PyString_AS_STRING(name));
25293  #else
25294  "cannot import name %S", name);
25295  #endif
25296  }
25297  return value;
25298 }
25299 
25300 /* HasAttr */
25301 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25302  PyObject *r;
25303  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25304  PyErr_SetString(PyExc_TypeError,
25305  "hasattr(): attribute name must be string");
25306  return -1;
25307  }
25308  r = __Pyx_GetAttr(o, n);
25309  if (unlikely(!r)) {
25310  PyErr_Clear();
25311  return 0;
25312  } else {
25313  Py_DECREF(r);
25314  return 1;
25315  }
25316 }
25317 
25318 /* StringJoin */
25319 #if !CYTHON_COMPILING_IN_CPYTHON
25320 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
25321  return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
25322 }
25323 #endif
25324 
25325 /* PyObject_GenericGetAttrNoDict */
25326 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25327 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25328  PyErr_Format(PyExc_AttributeError,
25329 #if PY_MAJOR_VERSION >= 3
25330  "'%.50s' object has no attribute '%U'",
25331  tp->tp_name, attr_name);
25332 #else
25333  "'%.50s' object has no attribute '%.400s'",
25334  tp->tp_name, PyString_AS_STRING(attr_name));
25335 #endif
25336  return NULL;
25337 }
25338 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25339  PyObject *descr;
25340  PyTypeObject *tp = Py_TYPE(obj);
25341  if (unlikely(!PyString_Check(attr_name))) {
25342  return PyObject_GenericGetAttr(obj, attr_name);
25343  }
25344  assert(!tp->tp_dictoffset);
25345  descr = _PyType_Lookup(tp, attr_name);
25346  if (unlikely(!descr)) {
25347  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25348  }
25349  Py_INCREF(descr);
25350  #if PY_MAJOR_VERSION < 3
25351  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25352  #endif
25353  {
25354  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
25355  if (unlikely(f)) {
25356  PyObject *res = f(descr, obj, (PyObject *)tp);
25357  Py_DECREF(descr);
25358  return res;
25359  }
25360  }
25361  return descr;
25362 }
25363 #endif
25364 
25365 /* PyObject_GenericGetAttr */
25366 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25367 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25368  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25369  return PyObject_GenericGetAttr(obj, attr_name);
25370  }
25371  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25372 }
25373 #endif
25374 
25375 /* SetVTable */
25376 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
25377 #if PY_VERSION_HEX >= 0x02070000
25378  PyObject *ob = PyCapsule_New(vtable, 0, 0);
25379 #else
25380  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25381 #endif
25382  if (!ob)
25383  goto bad;
25384  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25385  goto bad;
25386  Py_DECREF(ob);
25387  return 0;
25388 bad:
25389  Py_XDECREF(ob);
25390  return -1;
25391 }
25392 
25393 /* PyObjectGetAttrStrNoError */
25394 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
25395  __Pyx_PyThreadState_declare
25396  __Pyx_PyThreadState_assign
25397  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25398  __Pyx_PyErr_Clear();
25399 }
25400 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
25401  PyObject *result;
25402 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
25403  PyTypeObject* tp = Py_TYPE(obj);
25404  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
25405  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
25406  }
25407 #endif
25408  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
25409  if (unlikely(!result)) {
25410  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
25411  }
25412  return result;
25413 }
25414 
25415 /* SetupReduce */
25416 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25417  int ret;
25418  PyObject *name_attr;
25419  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25420  if (likely(name_attr)) {
25421  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25422  } else {
25423  ret = -1;
25424  }
25425  if (unlikely(ret < 0)) {
25426  PyErr_Clear();
25427  ret = 0;
25428  }
25429  Py_XDECREF(name_attr);
25430  return ret;
25431 }
25432 static int __Pyx_setup_reduce(PyObject* type_obj) {
25433  int ret = 0;
25434  PyObject *object_reduce = NULL;
25435  PyObject *object_reduce_ex = NULL;
25436  PyObject *reduce = NULL;
25437  PyObject *reduce_ex = NULL;
25438  PyObject *reduce_cython = NULL;
25439  PyObject *setstate = NULL;
25440  PyObject *setstate_cython = NULL;
25441 #if CYTHON_USE_PYTYPE_LOOKUP
25442  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
25443 #else
25444  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
25445 #endif
25446 #if CYTHON_USE_PYTYPE_LOOKUP
25447  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25448 #else
25449  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25450 #endif
25451  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
25452  if (reduce_ex == object_reduce_ex) {
25453 #if CYTHON_USE_PYTYPE_LOOKUP
25454  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25455 #else
25456  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25457 #endif
25458  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
25459  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25460  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
25461  if (likely(reduce_cython)) {
25462  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25463  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25464  } else if (reduce == object_reduce || PyErr_Occurred()) {
25465  goto __PYX_BAD;
25466  }
25467  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25468  if (!setstate) PyErr_Clear();
25469  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25470  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
25471  if (likely(setstate_cython)) {
25472  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25473  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25474  } else if (!setstate || PyErr_Occurred()) {
25475  goto __PYX_BAD;
25476  }
25477  }
25478  PyType_Modified((PyTypeObject*)type_obj);
25479  }
25480  }
25481  goto __PYX_GOOD;
25482 __PYX_BAD:
25483  if (!PyErr_Occurred())
25484  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25485  ret = -1;
25486 __PYX_GOOD:
25487 #if !CYTHON_USE_PYTYPE_LOOKUP
25488  Py_XDECREF(object_reduce);
25489  Py_XDECREF(object_reduce_ex);
25490 #endif
25491  Py_XDECREF(reduce);
25492  Py_XDECREF(reduce_ex);
25493  Py_XDECREF(reduce_cython);
25494  Py_XDECREF(setstate);
25495  Py_XDECREF(setstate_cython);
25496  return ret;
25497 }
25498 
25499 /* TypeImport */
25500 #ifndef __PYX_HAVE_RT_ImportType
25501 #define __PYX_HAVE_RT_ImportType
25502 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
25503  size_t size, enum __Pyx_ImportType_CheckSize check_size)
25504 {
25505  PyObject *result = 0;
25506  char warning[200];
25507  Py_ssize_t basicsize;
25508 #ifdef Py_LIMITED_API
25509  PyObject *py_basicsize;
25510 #endif
25511  result = PyObject_GetAttrString(module, class_name);
25512  if (!result)
25513  goto bad;
25514  if (!PyType_Check(result)) {
25515  PyErr_Format(PyExc_TypeError,
25516  "%.200s.%.200s is not a type object",
25517  module_name, class_name);
25518  goto bad;
25519  }
25520 #ifndef Py_LIMITED_API
25521  basicsize = ((PyTypeObject *)result)->tp_basicsize;
25522 #else
25523  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
25524  if (!py_basicsize)
25525  goto bad;
25526  basicsize = PyLong_AsSsize_t(py_basicsize);
25527  Py_DECREF(py_basicsize);
25528  py_basicsize = 0;
25529  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25530  goto bad;
25531 #endif
25532  if ((size_t)basicsize < size) {
25533  PyErr_Format(PyExc_ValueError,
25534  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25535  "Expected %zd from C header, got %zd from PyObject",
25536  module_name, class_name, size, basicsize);
25537  goto bad;
25538  }
25539  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
25540  PyErr_Format(PyExc_ValueError,
25541  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25542  "Expected %zd from C header, got %zd from PyObject",
25543  module_name, class_name, size, basicsize);
25544  goto bad;
25545  }
25546  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
25547  PyOS_snprintf(warning, sizeof(warning),
25548  "%s.%s size changed, may indicate binary incompatibility. "
25549  "Expected %zd from C header, got %zd from PyObject",
25550  module_name, class_name, size, basicsize);
25551  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
25552  }
25553  return (PyTypeObject *)result;
25554 bad:
25555  Py_XDECREF(result);
25556  return NULL;
25557 }
25558 #endif
25559 
25560 /* CLineInTraceback */
25561 #ifndef CYTHON_CLINE_IN_TRACEBACK
25562 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
25563  PyObject *use_cline;
25564  PyObject *ptype, *pvalue, *ptraceback;
25565 #if CYTHON_COMPILING_IN_CPYTHON
25566  PyObject **cython_runtime_dict;
25567 #endif
25568  if (unlikely(!__pyx_cython_runtime)) {
25569  return c_line;
25570  }
25571  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25572 #if CYTHON_COMPILING_IN_CPYTHON
25573  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
25574  if (likely(cython_runtime_dict)) {
25575  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
25576  use_cline, *cython_runtime_dict,
25577  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
25578  } else
25579 #endif
25580  {
25581  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
25582  if (use_cline_obj) {
25583  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
25584  Py_DECREF(use_cline_obj);
25585  } else {
25586  PyErr_Clear();
25587  use_cline = NULL;
25588  }
25589  }
25590  if (!use_cline) {
25591  c_line = 0;
25592  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
25593  }
25594  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
25595  c_line = 0;
25596  }
25597  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25598  return c_line;
25599 }
25600 #endif
25601 
25602 /* CodeObjectCache */
25603 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
25604  int start = 0, mid = 0, end = count - 1;
25605  if (end >= 0 && code_line > entries[end].code_line) {
25606  return count;
25607  }
25608  while (start < end) {
25609  mid = start + (end - start) / 2;
25610  if (code_line < entries[mid].code_line) {
25611  end = mid;
25612  } else if (code_line > entries[mid].code_line) {
25613  start = mid + 1;
25614  } else {
25615  return mid;
25616  }
25617  }
25618  if (code_line <= entries[mid].code_line) {
25619  return mid;
25620  } else {
25621  return mid + 1;
25622  }
25623 }
25624 static PyCodeObject *__pyx_find_code_object(int code_line) {
25625  PyCodeObject* code_object;
25626  int pos;
25627  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
25628  return NULL;
25629  }
25630  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25631  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
25632  return NULL;
25633  }
25634  code_object = __pyx_code_cache.entries[pos].code_object;
25635  Py_INCREF(code_object);
25636  return code_object;
25637 }
25638 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
25639  int pos, i;
25640  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
25641  if (unlikely(!code_line)) {
25642  return;
25643  }
25644  if (unlikely(!entries)) {
25645  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
25646  if (likely(entries)) {
25647  __pyx_code_cache.entries = entries;
25648  __pyx_code_cache.max_count = 64;
25649  __pyx_code_cache.count = 1;
25650  entries[0].code_line = code_line;
25651  entries[0].code_object = code_object;
25652  Py_INCREF(code_object);
25653  }
25654  return;
25655  }
25656  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25657  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
25658  PyCodeObject* tmp = entries[pos].code_object;
25659  entries[pos].code_object = code_object;
25660  Py_DECREF(tmp);
25661  return;
25662  }
25663  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
25664  int new_max = __pyx_code_cache.max_count + 64;
25665  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
25666  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
25667  if (unlikely(!entries)) {
25668  return;
25669  }
25670  __pyx_code_cache.entries = entries;
25671  __pyx_code_cache.max_count = new_max;
25672  }
25673  for (i=__pyx_code_cache.count; i>pos; i--) {
25674  entries[i] = entries[i-1];
25675  }
25676  entries[pos].code_line = code_line;
25677  entries[pos].code_object = code_object;
25678  __pyx_code_cache.count++;
25679  Py_INCREF(code_object);
25680 }
25681 
25682 /* AddTraceback */
25683 #include "compile.h"
25684 #include "frameobject.h"
25685 #include "traceback.h"
25686 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
25687  const char *funcname, int c_line,
25688  int py_line, const char *filename) {
25689  PyCodeObject *py_code = 0;
25690  PyObject *py_srcfile = 0;
25691  PyObject *py_funcname = 0;
25692  #if PY_MAJOR_VERSION < 3
25693  py_srcfile = PyString_FromString(filename);
25694  #else
25695  py_srcfile = PyUnicode_FromString(filename);
25696  #endif
25697  if (!py_srcfile) goto bad;
25698  if (c_line) {
25699  #if PY_MAJOR_VERSION < 3
25700  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25701  #else
25702  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25703  #endif
25704  }
25705  else {
25706  #if PY_MAJOR_VERSION < 3
25707  py_funcname = PyString_FromString(funcname);
25708  #else
25709  py_funcname = PyUnicode_FromString(funcname);
25710  #endif
25711  }
25712  if (!py_funcname) goto bad;
25713  py_code = __Pyx_PyCode_New(
25714  0,
25715  0,
25716  0,
25717  0,
25718  0,
25719  __pyx_empty_bytes, /*PyObject *code,*/
25720  __pyx_empty_tuple, /*PyObject *consts,*/
25721  __pyx_empty_tuple, /*PyObject *names,*/
25722  __pyx_empty_tuple, /*PyObject *varnames,*/
25723  __pyx_empty_tuple, /*PyObject *freevars,*/
25724  __pyx_empty_tuple, /*PyObject *cellvars,*/
25725  py_srcfile, /*PyObject *filename,*/
25726  py_funcname, /*PyObject *name,*/
25727  py_line,
25728  __pyx_empty_bytes /*PyObject *lnotab*/
25729  );
25730  Py_DECREF(py_srcfile);
25731  Py_DECREF(py_funcname);
25732  return py_code;
25733 bad:
25734  Py_XDECREF(py_srcfile);
25735  Py_XDECREF(py_funcname);
25736  return NULL;
25737 }
25738 static void __Pyx_AddTraceback(const char *funcname, int c_line,
25739  int py_line, const char *filename) {
25740  PyCodeObject *py_code = 0;
25741  PyFrameObject *py_frame = 0;
25742  PyThreadState *tstate = __Pyx_PyThreadState_Current;
25743  if (c_line) {
25744  c_line = __Pyx_CLineForTraceback(tstate, c_line);
25745  }
25746  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
25747  if (!py_code) {
25748  py_code = __Pyx_CreateCodeObjectForTraceback(
25749  funcname, c_line, py_line, filename);
25750  if (!py_code) goto bad;
25751  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
25752  }
25753  py_frame = PyFrame_New(
25754  tstate, /*PyThreadState *tstate,*/
25755  py_code, /*PyCodeObject *code,*/
25756  __pyx_d, /*PyObject *globals,*/
25757  0 /*PyObject *locals*/
25758  );
25759  if (!py_frame) goto bad;
25760  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
25761  PyTraceBack_Here(py_frame);
25762 bad:
25763  Py_XDECREF(py_code);
25764  Py_XDECREF(py_frame);
25765 }
25766 
25767 /* CIntFromPyVerify */
25768 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
25769  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
25770 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
25771  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
25772 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
25773  {\
25774  func_type value = func_value;\
25775  if (sizeof(target_type) < sizeof(func_type)) {\
25776  if (unlikely(value != (func_type) (target_type) value)) {\
25777  func_type zero = 0;\
25778  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
25779  return (target_type) -1;\
25780  if (is_unsigned && unlikely(value < zero))\
25781  goto raise_neg_overflow;\
25782  else\
25783  goto raise_overflow;\
25784  }\
25785  }\
25786  return (target_type) value;\
25787  }
25788 
25789 /* MemviewDtypeToObject */
25790 static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp) {
25791  return (PyObject *) __Pyx_PyInt_From_int(*(int *) itemp);
25792 }
25793 static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj) {
25794  int value = __Pyx_PyInt_As_int(obj);
25795  if ((value == (int)-1) && PyErr_Occurred())
25796  return 0;
25797  *(int *) itemp = value;
25798  return 1;
25799 }
25800 
25801 /* Declarations */
25802 #if CYTHON_CCOMPLEX
25803  #ifdef __cplusplus
25804  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
25805  return ::std::complex< float >(x, y);
25806  }
25807  #else
25808  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
25809  return x + y*(__pyx_t_float_complex)_Complex_I;
25810  }
25811  #endif
25812 #else
25813  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
25814  __pyx_t_float_complex z;
25815  z.real = x;
25816  z.imag = y;
25817  return z;
25818  }
25819 #endif
25820 
25821 /* Arithmetic */
25822 #if CYTHON_CCOMPLEX
25823 #else
25824  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25825  return (a.real == b.real) && (a.imag == b.imag);
25826  }
25827  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25828  __pyx_t_float_complex z;
25829  z.real = a.real + b.real;
25830  z.imag = a.imag + b.imag;
25831  return z;
25832  }
25833  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25834  __pyx_t_float_complex z;
25835  z.real = a.real - b.real;
25836  z.imag = a.imag - b.imag;
25837  return z;
25838  }
25839  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25840  __pyx_t_float_complex z;
25841  z.real = a.real * b.real - a.imag * b.imag;
25842  z.imag = a.real * b.imag + a.imag * b.real;
25843  return z;
25844  }
25845  #if 1
25846  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25847  if (b.imag == 0) {
25848  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
25849  } else if (fabsf(b.real) >= fabsf(b.imag)) {
25850  if (b.real == 0 && b.imag == 0) {
25851  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
25852  } else {
25853  float r = b.imag / b.real;
25854  float s = (float)(1.0) / (b.real + b.imag * r);
25855  return __pyx_t_float_complex_from_parts(
25856  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
25857  }
25858  } else {
25859  float r = b.real / b.imag;
25860  float s = (float)(1.0) / (b.imag + b.real * r);
25861  return __pyx_t_float_complex_from_parts(
25862  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
25863  }
25864  }
25865  #else
25866  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25867  if (b.imag == 0) {
25868  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
25869  } else {
25870  float denom = b.real * b.real + b.imag * b.imag;
25871  return __pyx_t_float_complex_from_parts(
25872  (a.real * b.real + a.imag * b.imag) / denom,
25873  (a.imag * b.real - a.real * b.imag) / denom);
25874  }
25875  }
25876  #endif
25877  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
25878  __pyx_t_float_complex z;
25879  z.real = -a.real;
25880  z.imag = -a.imag;
25881  return z;
25882  }
25883  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
25884  return (a.real == 0) && (a.imag == 0);
25885  }
25886  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
25887  __pyx_t_float_complex z;
25888  z.real = a.real;
25889  z.imag = -a.imag;
25890  return z;
25891  }
25892  #if 1
25893  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
25894  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
25895  return sqrtf(z.real*z.real + z.imag*z.imag);
25896  #else
25897  return hypotf(z.real, z.imag);
25898  #endif
25899  }
25900  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25901  __pyx_t_float_complex z;
25902  float r, lnr, theta, z_r, z_theta;
25903  if (b.imag == 0 && b.real == (int)b.real) {
25904  if (b.real < 0) {
25905  float denom = a.real * a.real + a.imag * a.imag;
25906  a.real = a.real / denom;
25907  a.imag = -a.imag / denom;
25908  b.real = -b.real;
25909  }
25910  switch ((int)b.real) {
25911  case 0:
25912  z.real = 1;
25913  z.imag = 0;
25914  return z;
25915  case 1:
25916  return a;
25917  case 2:
25918  return __Pyx_c_prod_float(a, a);
25919  case 3:
25920  z = __Pyx_c_prod_float(a, a);
25921  return __Pyx_c_prod_float(z, a);
25922  case 4:
25923  z = __Pyx_c_prod_float(a, a);
25924  return __Pyx_c_prod_float(z, z);
25925  }
25926  }
25927  if (a.imag == 0) {
25928  if (a.real == 0) {
25929  return a;
25930  } else if (b.imag == 0) {
25931  z.real = powf(a.real, b.real);
25932  z.imag = 0;
25933  return z;
25934  } else if (a.real > 0) {
25935  r = a.real;
25936  theta = 0;
25937  } else {
25938  r = -a.real;
25939  theta = atan2f(0.0, -1.0);
25940  }
25941  } else {
25942  r = __Pyx_c_abs_float(a);
25943  theta = atan2f(a.imag, a.real);
25944  }
25945  lnr = logf(r);
25946  z_r = expf(lnr * b.real - theta * b.imag);
25947  z_theta = theta * b.real + lnr * b.imag;
25948  z.real = z_r * cosf(z_theta);
25949  z.imag = z_r * sinf(z_theta);
25950  return z;
25951  }
25952  #endif
25953 #endif
25954 
25955 /* Declarations */
25956 #if CYTHON_CCOMPLEX
25957  #ifdef __cplusplus
25958  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
25959  return ::std::complex< double >(x, y);
25960  }
25961  #else
25962  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
25963  return x + y*(__pyx_t_double_complex)_Complex_I;
25964  }
25965  #endif
25966 #else
25967  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
25968  __pyx_t_double_complex z;
25969  z.real = x;
25970  z.imag = y;
25971  return z;
25972  }
25973 #endif
25974 
25975 /* Arithmetic */
25976 #if CYTHON_CCOMPLEX
25977 #else
25978  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25979  return (a.real == b.real) && (a.imag == b.imag);
25980  }
25981  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25982  __pyx_t_double_complex z;
25983  z.real = a.real + b.real;
25984  z.imag = a.imag + b.imag;
25985  return z;
25986  }
25987  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25988  __pyx_t_double_complex z;
25989  z.real = a.real - b.real;
25990  z.imag = a.imag - b.imag;
25991  return z;
25992  }
25993  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25994  __pyx_t_double_complex z;
25995  z.real = a.real * b.real - a.imag * b.imag;
25996  z.imag = a.real * b.imag + a.imag * b.real;
25997  return z;
25998  }
25999  #if 1
26000  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26001  if (b.imag == 0) {
26002  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26003  } else if (fabs(b.real) >= fabs(b.imag)) {
26004  if (b.real == 0 && b.imag == 0) {
26005  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
26006  } else {
26007  double r = b.imag / b.real;
26008  double s = (double)(1.0) / (b.real + b.imag * r);
26009  return __pyx_t_double_complex_from_parts(
26010  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
26011  }
26012  } else {
26013  double r = b.real / b.imag;
26014  double s = (double)(1.0) / (b.imag + b.real * r);
26015  return __pyx_t_double_complex_from_parts(
26016  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
26017  }
26018  }
26019  #else
26020  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26021  if (b.imag == 0) {
26022  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26023  } else {
26024  double denom = b.real * b.real + b.imag * b.imag;
26025  return __pyx_t_double_complex_from_parts(
26026  (a.real * b.real + a.imag * b.imag) / denom,
26027  (a.imag * b.real - a.real * b.imag) / denom);
26028  }
26029  }
26030  #endif
26031  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
26032  __pyx_t_double_complex z;
26033  z.real = -a.real;
26034  z.imag = -a.imag;
26035  return z;
26036  }
26037  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
26038  return (a.real == 0) && (a.imag == 0);
26039  }
26040  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
26041  __pyx_t_double_complex z;
26042  z.real = a.real;
26043  z.imag = -a.imag;
26044  return z;
26045  }
26046  #if 1
26047  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
26048  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26049  return sqrt(z.real*z.real + z.imag*z.imag);
26050  #else
26051  return hypot(z.real, z.imag);
26052  #endif
26053  }
26054  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26055  __pyx_t_double_complex z;
26056  double r, lnr, theta, z_r, z_theta;
26057  if (b.imag == 0 && b.real == (int)b.real) {
26058  if (b.real < 0) {
26059  double denom = a.real * a.real + a.imag * a.imag;
26060  a.real = a.real / denom;
26061  a.imag = -a.imag / denom;
26062  b.real = -b.real;
26063  }
26064  switch ((int)b.real) {
26065  case 0:
26066  z.real = 1;
26067  z.imag = 0;
26068  return z;
26069  case 1:
26070  return a;
26071  case 2:
26072  return __Pyx_c_prod_double(a, a);
26073  case 3:
26074  z = __Pyx_c_prod_double(a, a);
26075  return __Pyx_c_prod_double(z, a);
26076  case 4:
26077  z = __Pyx_c_prod_double(a, a);
26078  return __Pyx_c_prod_double(z, z);
26079  }
26080  }
26081  if (a.imag == 0) {
26082  if (a.real == 0) {
26083  return a;
26084  } else if (b.imag == 0) {
26085  z.real = pow(a.real, b.real);
26086  z.imag = 0;
26087  return z;
26088  } else if (a.real > 0) {
26089  r = a.real;
26090  theta = 0;
26091  } else {
26092  r = -a.real;
26093  theta = atan2(0.0, -1.0);
26094  }
26095  } else {
26096  r = __Pyx_c_abs_double(a);
26097  theta = atan2(a.imag, a.real);
26098  }
26099  lnr = log(r);
26100  z_r = exp(lnr * b.real - theta * b.imag);
26101  z_theta = theta * b.real + lnr * b.imag;
26102  z.real = z_r * cos(z_theta);
26103  z.imag = z_r * sin(z_theta);
26104  return z;
26105  }
26106  #endif
26107 #endif
26108 
26109 #if PY_MAJOR_VERSION < 3
26110 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
26111  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
26112  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
26113  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
26114  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26115  return -1;
26116 }
26117 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26118  PyObject *obj = view->obj;
26119  if (!obj) return;
26120  if (PyObject_CheckBuffer(obj)) {
26121  PyBuffer_Release(view);
26122  return;
26123  }
26124  if ((0)) {}
26125  view->obj = NULL;
26126  Py_DECREF(obj);
26127 }
26128 #endif
26129 
26130 
26131 /* MemviewSliceIsContig */
26132 static int
26133 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
26134 {
26135  int i, index, step, start;
26136  Py_ssize_t itemsize = mvs.memview->view.itemsize;
26137  if (order == 'F') {
26138  step = 1;
26139  start = 0;
26140  } else {
26141  step = -1;
26142  start = ndim - 1;
26143  }
26144  for (i = 0; i < ndim; i++) {
26145  index = start + step * i;
26146  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26147  return 0;
26148  itemsize *= mvs.shape[index];
26149  }
26150  return 1;
26151 }
26152 
26153 /* OverlappingSlices */
26154 static void
26155 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26156  void **out_start, void **out_end,
26157  int ndim, size_t itemsize)
26158 {
26159  char *start, *end;
26160  int i;
26161  start = end = slice->data;
26162  for (i = 0; i < ndim; i++) {
26163  Py_ssize_t stride = slice->strides[i];
26164  Py_ssize_t extent = slice->shape[i];
26165  if (extent == 0) {
26166  *out_start = *out_end = start;
26167  return;
26168  } else {
26169  if (stride > 0)
26170  end += stride * (extent - 1);
26171  else
26172  start += stride * (extent - 1);
26173  }
26174  }
26175  *out_start = start;
26176  *out_end = end + itemsize;
26177 }
26178 static int
26179 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26180  __Pyx_memviewslice *slice2,
26181  int ndim, size_t itemsize)
26182 {
26183  void *start1, *end1, *start2, *end2;
26184  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26185  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26186  return (start1 < end2) && (start2 < end1);
26187 }
26188 
26189 /* Capsule */
26190 static CYTHON_INLINE PyObject *
26191 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
26192 {
26193  PyObject *cobj;
26194 #if PY_VERSION_HEX >= 0x02070000
26195  cobj = PyCapsule_New(p, sig, NULL);
26196 #else
26197  cobj = PyCObject_FromVoidPtr(p, NULL);
26198 #endif
26199  return cobj;
26200 }
26201 
26202 /* CIntFromPy */
26203 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
26204 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26205 #pragma GCC diagnostic push
26206 #pragma GCC diagnostic ignored "-Wconversion"
26207 #endif
26208  const int neg_one = (int) -1, const_zero = (int) 0;
26209 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26210 #pragma GCC diagnostic pop
26211 #endif
26212  const int is_unsigned = neg_one > const_zero;
26213 #if PY_MAJOR_VERSION < 3
26214  if (likely(PyInt_Check(x))) {
26215  if (sizeof(int) < sizeof(long)) {
26216  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
26217  } else {
26218  long val = PyInt_AS_LONG(x);
26219  if (is_unsigned && unlikely(val < 0)) {
26220  goto raise_neg_overflow;
26221  }
26222  return (int) val;
26223  }
26224  } else
26225 #endif
26226  if (likely(PyLong_Check(x))) {
26227  if (is_unsigned) {
26228 #if CYTHON_USE_PYLONG_INTERNALS
26229  const digit* digits = ((PyLongObject*)x)->ob_digit;
26230  switch (Py_SIZE(x)) {
26231  case 0: return (int) 0;
26232  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
26233  case 2:
26234  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
26235  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26236  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26237  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
26238  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26239  }
26240  }
26241  break;
26242  case 3:
26243  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
26244  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26245  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26246  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
26247  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26248  }
26249  }
26250  break;
26251  case 4:
26252  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
26253  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26254  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26255  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
26256  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26257  }
26258  }
26259  break;
26260  }
26261 #endif
26262 #if CYTHON_COMPILING_IN_CPYTHON
26263  if (unlikely(Py_SIZE(x) < 0)) {
26264  goto raise_neg_overflow;
26265  }
26266 #else
26267  {
26268  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26269  if (unlikely(result < 0))
26270  return (int) -1;
26271  if (unlikely(result == 1))
26272  goto raise_neg_overflow;
26273  }
26274 #endif
26275  if (sizeof(int) <= sizeof(unsigned long)) {
26276  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
26277 #ifdef HAVE_LONG_LONG
26278  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
26279  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26280 #endif
26281  }
26282  } else {
26283 #if CYTHON_USE_PYLONG_INTERNALS
26284  const digit* digits = ((PyLongObject*)x)->ob_digit;
26285  switch (Py_SIZE(x)) {
26286  case 0: return (int) 0;
26287  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
26288  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
26289  case -2:
26290  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
26291  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26292  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26293  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26294  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26295  }
26296  }
26297  break;
26298  case 2:
26299  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
26300  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26301  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26302  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26303  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26304  }
26305  }
26306  break;
26307  case -3:
26308  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26309  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26310  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26311  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26312  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26313  }
26314  }
26315  break;
26316  case 3:
26317  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
26318  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26319  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26320  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26321  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26322  }
26323  }
26324  break;
26325  case -4:
26326  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26327  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26328  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26329  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
26330  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26331  }
26332  }
26333  break;
26334  case 4:
26335  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
26336  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26337  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26338  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
26339  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26340  }
26341  }
26342  break;
26343  }
26344 #endif
26345  if (sizeof(int) <= sizeof(long)) {
26346  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
26347 #ifdef HAVE_LONG_LONG
26348  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
26349  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
26350 #endif
26351  }
26352  }
26353  {
26354 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
26355  PyErr_SetString(PyExc_RuntimeError,
26356  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26357 #else
26358  int val;
26359  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
26360  #if PY_MAJOR_VERSION < 3
26361  if (likely(v) && !PyLong_Check(v)) {
26362  PyObject *tmp = v;
26363  v = PyNumber_Long(tmp);
26364  Py_DECREF(tmp);
26365  }
26366  #endif
26367  if (likely(v)) {
26368  int one = 1; int is_little = (int)*(unsigned char *)&one;
26369  unsigned char *bytes = (unsigned char *)&val;
26370  int ret = _PyLong_AsByteArray((PyLongObject *)v,
26371  bytes, sizeof(val),
26372  is_little, !is_unsigned);
26373  Py_DECREF(v);
26374  if (likely(!ret))
26375  return val;
26376  }
26377 #endif
26378  return (int) -1;
26379  }
26380  } else {
26381  int val;
26382  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26383  if (!tmp) return (int) -1;
26384  val = __Pyx_PyInt_As_int(tmp);
26385  Py_DECREF(tmp);
26386  return val;
26387  }
26388 raise_overflow:
26389  PyErr_SetString(PyExc_OverflowError,
26390  "value too large to convert to int");
26391  return (int) -1;
26392 raise_neg_overflow:
26393  PyErr_SetString(PyExc_OverflowError,
26394  "can't convert negative value to int");
26395  return (int) -1;
26396 }
26397 
26398 /* CIntToPy */
26399 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
26400 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26401 #pragma GCC diagnostic push
26402 #pragma GCC diagnostic ignored "-Wconversion"
26403 #endif
26404  const int neg_one = (int) -1, const_zero = (int) 0;
26405 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26406 #pragma GCC diagnostic pop
26407 #endif
26408  const int is_unsigned = neg_one > const_zero;
26409  if (is_unsigned) {
26410  if (sizeof(int) < sizeof(long)) {
26411  return PyInt_FromLong((long) value);
26412  } else if (sizeof(int) <= sizeof(unsigned long)) {
26413  return PyLong_FromUnsignedLong((unsigned long) value);
26414 #ifdef HAVE_LONG_LONG
26415  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
26416  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
26417 #endif
26418  }
26419  } else {
26420  if (sizeof(int) <= sizeof(long)) {
26421  return PyInt_FromLong((long) value);
26422 #ifdef HAVE_LONG_LONG
26423  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
26424  return PyLong_FromLongLong((PY_LONG_LONG) value);
26425 #endif
26426  }
26427  }
26428  {
26429  int one = 1; int little = (int)*(unsigned char *)&one;
26430  unsigned char *bytes = (unsigned char *)&value;
26431  return _PyLong_FromByteArray(bytes, sizeof(int),
26432  little, !is_unsigned);
26433  }
26434 }
26435 
26436 /* TypeInfoToFormat */
26437 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) {
26438  struct __pyx_typeinfo_string result = { {0} };
26439  char *buf = (char *) result.string;
26440  size_t size = type->size;
26441  switch (type->typegroup) {
26442  case 'H':
26443  *buf = 'c';
26444  break;
26445  case 'I':
26446  case 'U':
26447  if (size == 1)
26448  *buf = (type->is_unsigned) ? 'B' : 'b';
26449  else if (size == 2)
26450  *buf = (type->is_unsigned) ? 'H' : 'h';
26451  else if (size == 4)
26452  *buf = (type->is_unsigned) ? 'I' : 'i';
26453  else if (size == 8)
26454  *buf = (type->is_unsigned) ? 'Q' : 'q';
26455  break;
26456  case 'P':
26457  *buf = 'P';
26458  break;
26459  case 'C':
26460  {
26461  __Pyx_TypeInfo complex_type = *type;
26462  complex_type.typegroup = 'R';
26463  complex_type.size /= 2;
26464  *buf++ = 'Z';
26465  *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
26466  break;
26467  }
26468  case 'R':
26469  if (size == 4)
26470  *buf = 'f';
26471  else if (size == 8)
26472  *buf = 'd';
26473  else
26474  *buf = 'g';
26475  break;
26476  }
26477  return result;
26478 }
26479 
26480 /* MemviewSliceCopyTemplate */
26481 static __Pyx_memviewslice
26482 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
26483  const char *mode, int ndim,
26484  size_t sizeof_dtype, int contig_flag,
26485  int dtype_is_object)
26486 {
26487  __Pyx_RefNannyDeclarations
26488  int i;
26489  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
26490  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
26491  Py_buffer *buf = &from_memview->view;
26492  PyObject *shape_tuple = NULL;
26493  PyObject *temp_int = NULL;
26494  struct __pyx_array_obj *array_obj = NULL;
26495  struct __pyx_memoryview_obj *memview_obj = NULL;
26496  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
26497  for (i = 0; i < ndim; i++) {
26498  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
26499  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
26500  "indirect dimensions (axis %d)", i);
26501  goto fail;
26502  }
26503  }
26504  shape_tuple = PyTuple_New(ndim);
26505  if (unlikely(!shape_tuple)) {
26506  goto fail;
26507  }
26508  __Pyx_GOTREF(shape_tuple);
26509  for(i = 0; i < ndim; i++) {
26510  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
26511  if(unlikely(!temp_int)) {
26512  goto fail;
26513  } else {
26514  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
26515  temp_int = NULL;
26516  }
26517  }
26518  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
26519  if (unlikely(!array_obj)) {
26520  goto fail;
26521  }
26522  __Pyx_GOTREF(array_obj);
26523  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26524  (PyObject *) array_obj, contig_flag,
26525  dtype_is_object,
26526  from_mvs->memview->typeinfo);
26527  if (unlikely(!memview_obj))
26528  goto fail;
26529  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
26530  goto fail;
26531  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
26532  dtype_is_object) < 0))
26533  goto fail;
26534  goto no_fail;
26535 fail:
26536  __Pyx_XDECREF(new_mvs.memview);
26537  new_mvs.memview = NULL;
26538  new_mvs.data = NULL;
26539 no_fail:
26540  __Pyx_XDECREF(shape_tuple);
26541  __Pyx_XDECREF(temp_int);
26542  __Pyx_XDECREF(array_obj);
26543  __Pyx_RefNannyFinishContext();
26544  return new_mvs;
26545 }
26546 
26547 /* MemviewSliceInit */
26548 static int
26549 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
26550  int ndim,
26551  __Pyx_memviewslice *memviewslice,
26552  int memview_is_new_reference)
26553 {
26554  __Pyx_RefNannyDeclarations
26555  int i, retval=-1;
26556  Py_buffer *buf = &memview->view;
26557  __Pyx_RefNannySetupContext("init_memviewslice", 0);
26558  if (unlikely(memviewslice->memview || memviewslice->data)) {
26559  PyErr_SetString(PyExc_ValueError,
26560  "memviewslice is already initialized!");
26561  goto fail;
26562  }
26563  if (buf->strides) {
26564  for (i = 0; i < ndim; i++) {
26565  memviewslice->strides[i] = buf->strides[i];
26566  }
26567  } else {
26568  Py_ssize_t stride = buf->itemsize;
26569  for (i = ndim - 1; i >= 0; i--) {
26570  memviewslice->strides[i] = stride;
26571  stride *= buf->shape[i];
26572  }
26573  }
26574  for (i = 0; i < ndim; i++) {
26575  memviewslice->shape[i] = buf->shape[i];
26576  if (buf->suboffsets) {
26577  memviewslice->suboffsets[i] = buf->suboffsets[i];
26578  } else {
26579  memviewslice->suboffsets[i] = -1;
26580  }
26581  }
26582  memviewslice->memview = memview;
26583  memviewslice->data = (char *)buf->buf;
26584  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
26585  Py_INCREF(memview);
26586  }
26587  retval = 0;
26588  goto no_fail;
26589 fail:
26590  memviewslice->memview = 0;
26591  memviewslice->data = 0;
26592  retval = -1;
26593 no_fail:
26594  __Pyx_RefNannyFinishContext();
26595  return retval;
26596 }
26597 #ifndef Py_NO_RETURN
26598 #define Py_NO_RETURN
26599 #endif
26600 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
26601  va_list vargs;
26602  char msg[200];
26603 #ifdef HAVE_STDARG_PROTOTYPES
26604  va_start(vargs, fmt);
26605 #else
26606  va_start(vargs);
26607 #endif
26608  vsnprintf(msg, 200, fmt, vargs);
26609  va_end(vargs);
26610  Py_FatalError(msg);
26611 }
26612 static CYTHON_INLINE int
26613 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
26614  PyThread_type_lock lock)
26615 {
26616  int result;
26617  PyThread_acquire_lock(lock, 1);
26618  result = (*acquisition_count)++;
26619  PyThread_release_lock(lock);
26620  return result;
26621 }
26622 static CYTHON_INLINE int
26623 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
26624  PyThread_type_lock lock)
26625 {
26626  int result;
26627  PyThread_acquire_lock(lock, 1);
26628  result = (*acquisition_count)--;
26629  PyThread_release_lock(lock);
26630  return result;
26631 }
26632 static CYTHON_INLINE void
26633 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
26634 {
26635  int first_time;
26636  struct __pyx_memoryview_obj *memview = memslice->memview;
26637  if (unlikely(!memview || (PyObject *) memview == Py_None))
26638  return;
26639  if (unlikely(__pyx_get_slice_count(memview) < 0))
26640  __pyx_fatalerror("Acquisition count is %d (line %d)",
26641  __pyx_get_slice_count(memview), lineno);
26642  first_time = __pyx_add_acquisition_count(memview) == 0;
26643  if (unlikely(first_time)) {
26644  if (have_gil) {
26645  Py_INCREF((PyObject *) memview);
26646  } else {
26647  PyGILState_STATE _gilstate = PyGILState_Ensure();
26648  Py_INCREF((PyObject *) memview);
26649  PyGILState_Release(_gilstate);
26650  }
26651  }
26652 }
26653 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
26654  int have_gil, int lineno) {
26655  int last_time;
26656  struct __pyx_memoryview_obj *memview = memslice->memview;
26657  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
26658  memslice->memview = NULL;
26659  return;
26660  }
26661  if (unlikely(__pyx_get_slice_count(memview) <= 0))
26662  __pyx_fatalerror("Acquisition count is %d (line %d)",
26663  __pyx_get_slice_count(memview), lineno);
26664  last_time = __pyx_sub_acquisition_count(memview) == 1;
26665  memslice->data = NULL;
26666  if (unlikely(last_time)) {
26667  if (have_gil) {
26668  Py_CLEAR(memslice->memview);
26669  } else {
26670  PyGILState_STATE _gilstate = PyGILState_Ensure();
26671  Py_CLEAR(memslice->memview);
26672  PyGILState_Release(_gilstate);
26673  }
26674  } else {
26675  memslice->memview = NULL;
26676  }
26677 }
26678 
26679 /* CIntFromPy */
26680 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
26681 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26682 #pragma GCC diagnostic push
26683 #pragma GCC diagnostic ignored "-Wconversion"
26684 #endif
26685  const long neg_one = (long) -1, const_zero = (long) 0;
26686 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26687 #pragma GCC diagnostic pop
26688 #endif
26689  const int is_unsigned = neg_one > const_zero;
26690 #if PY_MAJOR_VERSION < 3
26691  if (likely(PyInt_Check(x))) {
26692  if (sizeof(long) < sizeof(long)) {
26693  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
26694  } else {
26695  long val = PyInt_AS_LONG(x);
26696  if (is_unsigned && unlikely(val < 0)) {
26697  goto raise_neg_overflow;
26698  }
26699  return (long) val;
26700  }
26701  } else
26702 #endif
26703  if (likely(PyLong_Check(x))) {
26704  if (is_unsigned) {
26705 #if CYTHON_USE_PYLONG_INTERNALS
26706  const digit* digits = ((PyLongObject*)x)->ob_digit;
26707  switch (Py_SIZE(x)) {
26708  case 0: return (long) 0;
26709  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
26710  case 2:
26711  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
26712  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26713  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26714  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
26715  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
26716  }
26717  }
26718  break;
26719  case 3:
26720  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
26721  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26722  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26723  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
26724  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
26725  }
26726  }
26727  break;
26728  case 4:
26729  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
26730  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26731  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26732  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
26733  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
26734  }
26735  }
26736  break;
26737  }
26738 #endif
26739 #if CYTHON_COMPILING_IN_CPYTHON
26740  if (unlikely(Py_SIZE(x) < 0)) {
26741  goto raise_neg_overflow;
26742  }
26743 #else
26744  {
26745  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26746  if (unlikely(result < 0))
26747  return (long) -1;
26748  if (unlikely(result == 1))
26749  goto raise_neg_overflow;
26750  }
26751 #endif
26752  if (sizeof(long) <= sizeof(unsigned long)) {
26753  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
26754 #ifdef HAVE_LONG_LONG
26755  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
26756  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26757 #endif
26758  }
26759  } else {
26760 #if CYTHON_USE_PYLONG_INTERNALS
26761  const digit* digits = ((PyLongObject*)x)->ob_digit;
26762  switch (Py_SIZE(x)) {
26763  case 0: return (long) 0;
26764  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
26765  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
26766  case -2:
26767  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
26768  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26769  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26770  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26771  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26772  }
26773  }
26774  break;
26775  case 2:
26776  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
26777  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26778  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26779  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26780  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26781  }
26782  }
26783  break;
26784  case -3:
26785  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26786  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26787  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26788  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26789  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26790  }
26791  }
26792  break;
26793  case 3:
26794  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
26795  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26796  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26797  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26798  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26799  }
26800  }
26801  break;
26802  case -4:
26803  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26804  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26805  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26806  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
26807  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26808  }
26809  }
26810  break;
26811  case 4:
26812  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
26813  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26814  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26815  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
26816  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26817  }
26818  }
26819  break;
26820  }
26821 #endif
26822  if (sizeof(long) <= sizeof(long)) {
26823  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
26824 #ifdef HAVE_LONG_LONG
26825  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
26826  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
26827 #endif
26828  }
26829  }
26830  {
26831 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
26832  PyErr_SetString(PyExc_RuntimeError,
26833  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26834 #else
26835  long val;
26836  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
26837  #if PY_MAJOR_VERSION < 3
26838  if (likely(v) && !PyLong_Check(v)) {
26839  PyObject *tmp = v;
26840  v = PyNumber_Long(tmp);
26841  Py_DECREF(tmp);
26842  }
26843  #endif
26844  if (likely(v)) {
26845  int one = 1; int is_little = (int)*(unsigned char *)&one;
26846  unsigned char *bytes = (unsigned char *)&val;
26847  int ret = _PyLong_AsByteArray((PyLongObject *)v,
26848  bytes, sizeof(val),
26849  is_little, !is_unsigned);
26850  Py_DECREF(v);
26851  if (likely(!ret))
26852  return val;
26853  }
26854 #endif
26855  return (long) -1;
26856  }
26857  } else {
26858  long val;
26859  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26860  if (!tmp) return (long) -1;
26861  val = __Pyx_PyInt_As_long(tmp);
26862  Py_DECREF(tmp);
26863  return val;
26864  }
26865 raise_overflow:
26866  PyErr_SetString(PyExc_OverflowError,
26867  "value too large to convert to long");
26868  return (long) -1;
26869 raise_neg_overflow:
26870  PyErr_SetString(PyExc_OverflowError,
26871  "can't convert negative value to long");
26872  return (long) -1;
26873 }
26874 
26875 /* CIntToPy */
26876 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
26877 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26878 #pragma GCC diagnostic push
26879 #pragma GCC diagnostic ignored "-Wconversion"
26880 #endif
26881  const long neg_one = (long) -1, const_zero = (long) 0;
26882 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26883 #pragma GCC diagnostic pop
26884 #endif
26885  const int is_unsigned = neg_one > const_zero;
26886  if (is_unsigned) {
26887  if (sizeof(long) < sizeof(long)) {
26888  return PyInt_FromLong((long) value);
26889  } else if (sizeof(long) <= sizeof(unsigned long)) {
26890  return PyLong_FromUnsignedLong((unsigned long) value);
26891 #ifdef HAVE_LONG_LONG
26892  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
26893  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
26894 #endif
26895  }
26896  } else {
26897  if (sizeof(long) <= sizeof(long)) {
26898  return PyInt_FromLong((long) value);
26899 #ifdef HAVE_LONG_LONG
26900  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
26901  return PyLong_FromLongLong((PY_LONG_LONG) value);
26902 #endif
26903  }
26904  }
26905  {
26906  int one = 1; int little = (int)*(unsigned char *)&one;
26907  unsigned char *bytes = (unsigned char *)&value;
26908  return _PyLong_FromByteArray(bytes, sizeof(long),
26909  little, !is_unsigned);
26910  }
26911 }
26912 
26913 /* CIntFromPy */
26914 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
26915 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26916 #pragma GCC diagnostic push
26917 #pragma GCC diagnostic ignored "-Wconversion"
26918 #endif
26919  const char neg_one = (char) -1, const_zero = (char) 0;
26920 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26921 #pragma GCC diagnostic pop
26922 #endif
26923  const int is_unsigned = neg_one > const_zero;
26924 #if PY_MAJOR_VERSION < 3
26925  if (likely(PyInt_Check(x))) {
26926  if (sizeof(char) < sizeof(long)) {
26927  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
26928  } else {
26929  long val = PyInt_AS_LONG(x);
26930  if (is_unsigned && unlikely(val < 0)) {
26931  goto raise_neg_overflow;
26932  }
26933  return (char) val;
26934  }
26935  } else
26936 #endif
26937  if (likely(PyLong_Check(x))) {
26938  if (is_unsigned) {
26939 #if CYTHON_USE_PYLONG_INTERNALS
26940  const digit* digits = ((PyLongObject*)x)->ob_digit;
26941  switch (Py_SIZE(x)) {
26942  case 0: return (char) 0;
26943  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
26944  case 2:
26945  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
26946  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26947  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26948  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
26949  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
26950  }
26951  }
26952  break;
26953  case 3:
26954  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
26955  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26956  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26957  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
26958  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
26959  }
26960  }
26961  break;
26962  case 4:
26963  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
26964  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26965  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26966  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
26967  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
26968  }
26969  }
26970  break;
26971  }
26972 #endif
26973 #if CYTHON_COMPILING_IN_CPYTHON
26974  if (unlikely(Py_SIZE(x) < 0)) {
26975  goto raise_neg_overflow;
26976  }
26977 #else
26978  {
26979  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26980  if (unlikely(result < 0))
26981  return (char) -1;
26982  if (unlikely(result == 1))
26983  goto raise_neg_overflow;
26984  }
26985 #endif
26986  if (sizeof(char) <= sizeof(unsigned long)) {
26987  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
26988 #ifdef HAVE_LONG_LONG
26989  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
26990  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26991 #endif
26992  }
26993  } else {
26994 #if CYTHON_USE_PYLONG_INTERNALS
26995  const digit* digits = ((PyLongObject*)x)->ob_digit;
26996  switch (Py_SIZE(x)) {
26997  case 0: return (char) 0;
26998  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
26999  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
27000  case -2:
27001  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
27002  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27003  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27004  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27005  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27006  }
27007  }
27008  break;
27009  case 2:
27010  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
27011  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27012  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27013  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27014  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27015  }
27016  }
27017  break;
27018  case -3:
27019  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27020  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27021  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27022  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27023  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27024  }
27025  }
27026  break;
27027  case 3:
27028  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
27029  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27030  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27031  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27032  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27033  }
27034  }
27035  break;
27036  case -4:
27037  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27038  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27039  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27040  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
27041  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27042  }
27043  }
27044  break;
27045  case 4:
27046  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
27047  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27048  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27049  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
27050  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27051  }
27052  }
27053  break;
27054  }
27055 #endif
27056  if (sizeof(char) <= sizeof(long)) {
27057  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
27058 #ifdef HAVE_LONG_LONG
27059  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
27060  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
27061 #endif
27062  }
27063  }
27064  {
27065 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27066  PyErr_SetString(PyExc_RuntimeError,
27067  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27068 #else
27069  char val;
27070  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27071  #if PY_MAJOR_VERSION < 3
27072  if (likely(v) && !PyLong_Check(v)) {
27073  PyObject *tmp = v;
27074  v = PyNumber_Long(tmp);
27075  Py_DECREF(tmp);
27076  }
27077  #endif
27078  if (likely(v)) {
27079  int one = 1; int is_little = (int)*(unsigned char *)&one;
27080  unsigned char *bytes = (unsigned char *)&val;
27081  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27082  bytes, sizeof(val),
27083  is_little, !is_unsigned);
27084  Py_DECREF(v);
27085  if (likely(!ret))
27086  return val;
27087  }
27088 #endif
27089  return (char) -1;
27090  }
27091  } else {
27092  char val;
27093  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27094  if (!tmp) return (char) -1;
27095  val = __Pyx_PyInt_As_char(tmp);
27096  Py_DECREF(tmp);
27097  return val;
27098  }
27099 raise_overflow:
27100  PyErr_SetString(PyExc_OverflowError,
27101  "value too large to convert to char");
27102  return (char) -1;
27103 raise_neg_overflow:
27104  PyErr_SetString(PyExc_OverflowError,
27105  "can't convert negative value to char");
27106  return (char) -1;
27107 }
27108 
27109 /* CheckBinaryVersion */
27110 static int __Pyx_check_binary_version(void) {
27111  char ctversion[4], rtversion[4];
27112  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
27113  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
27114  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
27115  char message[200];
27116  PyOS_snprintf(message, sizeof(message),
27117  "compiletime version %s of module '%.100s' "
27118  "does not match runtime version %s",
27119  ctversion, __Pyx_MODULE_NAME, rtversion);
27120  return PyErr_WarnEx(NULL, message, 1);
27121  }
27122  return 0;
27123 }
27124 
27125 /* InitStrings */
27126 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
27127  while (t->p) {
27128  #if PY_MAJOR_VERSION < 3
27129  if (t->is_unicode) {
27130  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
27131  } else if (t->intern) {
27132  *t->p = PyString_InternFromString(t->s);
27133  } else {
27134  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
27135  }
27136  #else
27137  if (t->is_unicode | t->is_str) {
27138  if (t->intern) {
27139  *t->p = PyUnicode_InternFromString(t->s);
27140  } else if (t->encoding) {
27141  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
27142  } else {
27143  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
27144  }
27145  } else {
27146  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
27147  }
27148  #endif
27149  if (!*t->p)
27150  return -1;
27151  if (PyObject_Hash(*t->p) == -1)
27152  return -1;
27153  ++t;
27154  }
27155  return 0;
27156 }
27157 
27158 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
27159  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
27160 }
27161 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
27162  Py_ssize_t ignore;
27163  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
27164 }
27165 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27166 #if !CYTHON_PEP393_ENABLED
27167 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27168  char* defenc_c;
27169  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
27170  if (!defenc) return NULL;
27171  defenc_c = PyBytes_AS_STRING(defenc);
27172 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27173  {
27174  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
27175  char* c;
27176  for (c = defenc_c; c < end; c++) {
27177  if ((unsigned char) (*c) >= 128) {
27178  PyUnicode_AsASCIIString(o);
27179  return NULL;
27180  }
27181  }
27182  }
27183 #endif
27184  *length = PyBytes_GET_SIZE(defenc);
27185  return defenc_c;
27186 }
27187 #else
27188 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27189  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
27190 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27191  if (likely(PyUnicode_IS_ASCII(o))) {
27192  *length = PyUnicode_GET_LENGTH(o);
27193  return PyUnicode_AsUTF8(o);
27194  } else {
27195  PyUnicode_AsASCIIString(o);
27196  return NULL;
27197  }
27198 #else
27199  return PyUnicode_AsUTF8AndSize(o, length);
27200 #endif
27201 }
27202 #endif
27203 #endif
27204 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27205 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27206  if (
27207 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27208  __Pyx_sys_getdefaultencoding_not_ascii &&
27209 #endif
27210  PyUnicode_Check(o)) {
27211  return __Pyx_PyUnicode_AsStringAndSize(o, length);
27212  } else
27213 #endif
27214 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
27215  if (PyByteArray_Check(o)) {
27216  *length = PyByteArray_GET_SIZE(o);
27217  return PyByteArray_AS_STRING(o);
27218  } else
27219 #endif
27220  {
27221  char* result;
27222  int r = PyBytes_AsStringAndSize(o, &result, length);
27223  if (unlikely(r < 0)) {
27224  return NULL;
27225  } else {
27226  return result;
27227  }
27228  }
27229 }
27230 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
27231  int is_true = x == Py_True;
27232  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
27233  else return PyObject_IsTrue(x);
27234 }
27235 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
27236  int retval;
27237  if (unlikely(!x)) return -1;
27238  retval = __Pyx_PyObject_IsTrue(x);
27239  Py_DECREF(x);
27240  return retval;
27241 }
27242 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
27243 #if PY_MAJOR_VERSION >= 3
27244  if (PyLong_Check(result)) {
27245  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
27246  "__int__ returned non-int (type %.200s). "
27247  "The ability to return an instance of a strict subclass of int "
27248  "is deprecated, and may be removed in a future version of Python.",
27249  Py_TYPE(result)->tp_name)) {
27250  Py_DECREF(result);
27251  return NULL;
27252  }
27253  return result;
27254  }
27255 #endif
27256  PyErr_Format(PyExc_TypeError,
27257  "__%.4s__ returned non-%.4s (type %.200s)",
27258  type_name, type_name, Py_TYPE(result)->tp_name);
27259  Py_DECREF(result);
27260  return NULL;
27261 }
27262 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
27263 #if CYTHON_USE_TYPE_SLOTS
27264  PyNumberMethods *m;
27265 #endif
27266  const char *name = NULL;
27267  PyObject *res = NULL;
27268 #if PY_MAJOR_VERSION < 3
27269  if (likely(PyInt_Check(x) || PyLong_Check(x)))
27270 #else
27271  if (likely(PyLong_Check(x)))
27272 #endif
27273  return __Pyx_NewRef(x);
27274 #if CYTHON_USE_TYPE_SLOTS
27275  m = Py_TYPE(x)->tp_as_number;
27276  #if PY_MAJOR_VERSION < 3
27277  if (m && m->nb_int) {
27278  name = "int";
27279  res = m->nb_int(x);
27280  }
27281  else if (m && m->nb_long) {
27282  name = "long";
27283  res = m->nb_long(x);
27284  }
27285  #else
27286  if (likely(m && m->nb_int)) {
27287  name = "int";
27288  res = m->nb_int(x);
27289  }
27290  #endif
27291 #else
27292  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
27293  res = PyNumber_Int(x);
27294  }
27295 #endif
27296  if (likely(res)) {
27297 #if PY_MAJOR_VERSION < 3
27298  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
27299 #else
27300  if (unlikely(!PyLong_CheckExact(res))) {
27301 #endif
27302  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
27303  }
27304  }
27305  else if (!PyErr_Occurred()) {
27306  PyErr_SetString(PyExc_TypeError,
27307  "an integer is required");
27308  }
27309  return res;
27310 }
27311 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
27312  Py_ssize_t ival;
27313  PyObject *x;
27314 #if PY_MAJOR_VERSION < 3
27315  if (likely(PyInt_CheckExact(b))) {
27316  if (sizeof(Py_ssize_t) >= sizeof(long))
27317  return PyInt_AS_LONG(b);
27318  else
27319  return PyInt_AsSsize_t(b);
27320  }
27321 #endif
27322  if (likely(PyLong_CheckExact(b))) {
27323  #if CYTHON_USE_PYLONG_INTERNALS
27324  const digit* digits = ((PyLongObject*)b)->ob_digit;
27325  const Py_ssize_t size = Py_SIZE(b);
27326  if (likely(__Pyx_sst_abs(size) <= 1)) {
27327  ival = likely(size) ? digits[0] : 0;
27328  if (size == -1) ival = -ival;
27329  return ival;
27330  } else {
27331  switch (size) {
27332  case 2:
27333  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27334  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27335  }
27336  break;
27337  case -2:
27338  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27339  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27340  }
27341  break;
27342  case 3:
27343  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27344  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27345  }
27346  break;
27347  case -3:
27348  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27349  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27350  }
27351  break;
27352  case 4:
27353  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27354  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27355  }
27356  break;
27357  case -4:
27358  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27359  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27360  }
27361  break;
27362  }
27363  }
27364  #endif
27365  return PyLong_AsSsize_t(b);
27366  }
27367  x = PyNumber_Index(b);
27368  if (!x) return -1;
27369  ival = PyInt_AsSsize_t(x);
27370  Py_DECREF(x);
27371  return ival;
27372 }
27373 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
27374  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
27375 }
27376 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
27377  return PyInt_FromSize_t(ival);
27378 }
27379 
27380 
27381 #endif /* Py_PYTHON_H */
Mesh::nodeDiametersArray
double * nodeDiametersArray
Definition: mesh.h:69
proteus::partitionElements
int partitionElements(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, int nElements_overlap)
Definition: partitioning.cpp:4451
Mesh::interiorElementBoundariesArray
int * interiorElementBoundariesArray
Definition: mesh.h:50
Mesh::elementBoundaryNodesArray
int * elementBoundaryNodesArray
Definition: mesh.h:47
proteus::partitionNodesFromTriangleFiles
int partitionNodesFromTriangleFiles(const MPI_Comm &PROTEUS_COMM_WORLD, const char *filebase, int indexBase, Mesh &newMesh, int nNodes_overlap)
Definition: partitioning.cpp:2958
Mesh::nodeArray
double * nodeArray
Definition: mesh.h:67
Mesh::nodeElementsArray
int * nodeElementsArray
Definition: mesh.h:43
Mesh::max_nElements_node
int max_nElements_node
Definition: mesh.h:38
Mesh::pz
int pz
Definition: mesh.h:64
Mesh::nodeElementOffsets
int * nodeElementOffsets
Definition: mesh.h:44
proteus::buildQuadraticSubdomain2GlobalMappings_2d
int buildQuadraticSubdomain2GlobalMappings_2d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *elementBoundaryOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *elementBoundaryNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
Definition: partitioning.cpp:5638
Mesh
Definition: mesh.h:27
Mesh::nEdges_global
int nEdges_global
Definition: mesh.h:39
Mesh::exteriorElementBoundariesArray
int * exteriorElementBoundariesArray
Definition: mesh.h:51
f
Double f
Definition: Headers.h:64
s
Double s
Definition: Headers.h:84
Mesh::nodeStarOffsets
int * nodeStarOffsets
Definition: mesh.h:54
Mesh::volume
double volume
Definition: mesh.h:70
Mesh::nNodes_elementBoundary
int nNodes_elementBoundary
Definition: mesh.h:33
Mesh::nElementBoundaries_global
int nElementBoundaries_global
Definition: mesh.h:35
partitioning.h
Mesh::hMin
double hMin
Definition: mesh.h:70
L
Double L
Definition: Headers.h:72
n
Int n
Definition: Headers.h:28
q
Double q
Definition: Headers.h:81
proteus::buildQuadraticCubeSubdomain2GlobalMappings_3d
int buildQuadraticCubeSubdomain2GlobalMappings_3d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *edgeOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *edgeNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
Definition: partitioning.cpp:6076
proteus::buildQuadraticSubdomain2GlobalMappings_1d
int buildQuadraticSubdomain2GlobalMappings_1d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *elementOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *elementNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
Definition: partitioning.cpp:5486
Mesh::nInteriorElementBoundaries_global
int nInteriorElementBoundaries_global
Definition: mesh.h:36
Mesh::ny
int ny
Definition: mesh.h:63
Mesh::nodeStarArray
int * nodeStarArray
Definition: mesh.h:53
Mesh::h
double h
Definition: mesh.h:70
Mesh::nNodes_element
int nNodes_element
Definition: mesh.h:32
Mesh::elementBoundaryLocalElementBoundariesArray
int * elementBoundaryLocalElementBoundariesArray
Definition: mesh.h:49
U
Double U
Definition: Headers.h:88
v
Double v
Definition: Headers.h:95
Mesh::elementBoundaryMaterialTypes
int * elementBoundaryMaterialTypes
Definition: mesh.h:56
Mesh::elementInnerDiametersArray
double * elementInnerDiametersArray
Definition: mesh.h:67
T
Double T
Definition: Headers.h:87
Mesh::V_KNOT
double * V_KNOT
Definition: mesh.h:62
z
Double * z
Definition: Headers.h:49
proteus::buildQuadraticSubdomain2GlobalMappings_3d
int buildQuadraticSubdomain2GlobalMappings_3d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *edgeOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *edgeNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
Definition: partitioning.cpp:5797
Mesh::elementNodesArray
int * elementNodesArray
Definition: mesh.h:42
u
Double u
Definition: Headers.h:89
Mesh::elementBoundaryBarycentersArray
double * elementBoundaryBarycentersArray
Definition: mesh.h:68
Mesh::py
int py
Definition: mesh.h:64
Mesh::nz
int nz
Definition: mesh.h:63
Mesh::elementBoundariesArray
int * elementBoundariesArray
Definition: mesh.h:46
Mesh::elementBarycentersArray
double * elementBarycentersArray
Definition: mesh.h:68
c
Double c
Definition: Headers.h:54
Mesh::nElements_global
int nElements_global
Definition: mesh.h:30
mesh.h
Mesh::nodeMaterialTypes
int * nodeMaterialTypes
Definition: mesh.h:57
proteus::partitionNodes
int partitionNodes(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, int nNodes_overlap)
Definition: partitioning.cpp:539
Mesh::nElementBoundaries_element
int nElementBoundaries_element
Definition: mesh.h:34
Mesh::elementMaterialTypes
int * elementMaterialTypes
Definition: mesh.h:55
Mesh::elementDiametersArray
double * elementDiametersArray
Definition: mesh.h:67
Mesh::nNodes_global
int nNodes_global
Definition: mesh.h:31
Mesh::nExteriorElementBoundaries_global
int nExteriorElementBoundaries_global
Definition: mesh.h:37
Mesh::px
int px
Definition: mesh.h:64
proteus::partitionNodesFromTetgenFiles
int partitionNodesFromTetgenFiles(const MPI_Comm &PROTEUS_COMM_WORLD, const char *filebase, int indexBase, Mesh &newMesh, int nNodes_overlap)
Definition: partitioning.cpp:1464
Mesh::W_KNOT
double * W_KNOT
Definition: mesh.h:62
Mesh::elementIJK
int * elementIJK
Definition: mesh.h:60
Mesh::max_nNodeNeighbors_node
int max_nNodeNeighbors_node
Definition: mesh.h:40
proteus::buildDiscontinuousGalerkinSubdomain2GlobalMappings
int buildDiscontinuousGalerkinSubdomain2GlobalMappings(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *elementOffsets_subdomain_owned, const int *elementNumbering_subdomain2global, int nDOF_element, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global)
Definition: partitioning.cpp:6450
Mesh::sigmaMax
double sigmaMax
Definition: mesh.h:70
Mesh::nodeSupportArray
double * nodeSupportArray
Definition: mesh.h:69
r
Double r
Definition: Headers.h:83
Mesh::weights
double * weights
Definition: mesh.h:61
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8
Mesh::edgeNodesArray
int * edgeNodesArray
Definition: mesh.h:52
Mesh::nx
int nx
Definition: mesh.h:63
Mesh::elementBoundaryDiametersArray
double * elementBoundaryDiametersArray
Definition: mesh.h:67
Mesh::elementBoundaryElementsArray
int * elementBoundaryElementsArray
Definition: mesh.h:48
Mesh::elementNeighborsArray
int * elementNeighborsArray
Definition: mesh.h:45
Mesh::U_KNOT
double * U_KNOT
Definition: mesh.h:62